本文整理汇总了Java中com.esri.core.map.Graphic.getSymbol方法的典型用法代码示例。如果您正苦于以下问题:Java Graphic.getSymbol方法的具体用法?Java Graphic.getSymbol怎么用?Java Graphic.getSymbol使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.esri.core.map.Graphic
的用法示例。
在下文中一共展示了Graphic.getSymbol方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: executeDriveTimes
import com.esri.core.map.Graphic; //导入方法依赖的package包/类
private void executeDriveTimes(Graphic startPointGraphic) {
// create a Geoprocessor that points to the remote geoprocessing service.
Geoprocessor geoprocessor = new Geoprocessor(URL_GEOPROCESSING_SERVICE);
// set the output and process spatial reference to the map's spatial reference
SpatialReference outSR = SpatialReference.create(4326);
Geometry projectedStartPoint = GeometryEngine.project(
startPointGraphic.getGeometry(), jMap.getSpatialReference(), outSR);
Graphic projectedStartPointGraphic = new Graphic(projectedStartPoint, startPointGraphic.getSymbol());
geoprocessor.setOutSR(outSR);
geoprocessor.setProcessSR(outSR);
// initialize the required input parameters: refer to help link in the
// geoprocessing service URL for a list of required parameters
List<GPParameter> gpInputParams = new ArrayList<GPParameter>();
GPFeatureRecordSetLayer gpInputStartpoint = new GPFeatureRecordSetLayer("Input_Location");
gpInputStartpoint.addGraphic(projectedStartPointGraphic);
GPString gpInputDriveTimes = new GPString("Drive_Time");
// Tip: use GP service info to get the parameter names
// GPString gpInputDriveTimes = new GPString("Drive_Times");
gpInputDriveTimes.setValue("1 2 3");
gpInputParams.add(gpInputStartpoint);
gpInputParams.add(gpInputDriveTimes);
// execute the geoprocessing request
try {
GPParameter[] result = geoprocessor.execute(gpInputParams);
updateProgresBarUI(null, tasksInProgress.decrementAndGet() > 0);
processResult(result);
} catch (Exception ex) {
JOptionPane.showMessageDialog(map, ex.getMessage(), "", JOptionPane.ERROR_MESSAGE);
}
/*// Tip: Do not block UI thread.
geoprocessor.executeAsync(
gpInputParams,
new CallbackListener<GPParameter[]>() {
@Override
public void onError(Throwable th) {
th.printStackTrace();
}
@Override
public void onCallback(GPParameter[] result) {
updateProgresBarUI(null, tasksInProgress.decrementAndGet() > 0);
processResult(result);
}
}
); */
}
示例2: executeDriveTimes
import com.esri.core.map.Graphic; //导入方法依赖的package包/类
private void executeDriveTimes(Graphic startPointGraphic) {
// create a Geoprocessor that points to the remote geoprocessing service.
Geoprocessor geoprocessor = new Geoprocessor(URL_GEOPROCESSING_SERVICE);
// set the output and process spatial reference to the map's spatial reference
SpatialReference outSR = SpatialReference.create(4326);
Geometry projectedStartPoint = GeometryEngine.project(
startPointGraphic.getGeometry(), jMap.getSpatialReference(), outSR);
Graphic projectedStartPointGraphic = new Graphic(projectedStartPoint, startPointGraphic.getSymbol());
geoprocessor.setOutSR(outSR);
geoprocessor.setProcessSR(outSR);
// initialize the required input parameters: refer to help link in the
// geoprocessing service URL for a list of required parameters
List<GPParameter> gpInputParams = new ArrayList<GPParameter>();
GPFeatureRecordSetLayer gpInputStartpoint = new GPFeatureRecordSetLayer("Input_Location");
gpInputStartpoint.addGraphic(projectedStartPointGraphic);
//GPString gpInputDriveTimes = new GPString("Drive_Time");
// Tip: use GP service info to get the parameter names
GPString gpInputDriveTimes = new GPString("Drive_Times");
gpInputDriveTimes.setValue("1 2 3");
gpInputParams.add(gpInputStartpoint);
gpInputParams.add(gpInputDriveTimes);
// execute the geoprocessing request
/*try {
GPParameter[] result = geoprocessor.execute(gpInputParams);
updateProgresBarUI(null, tasksInProgress.decrementAndGet() > 0);
processResult(result);
} catch (Exception ex) {
JOptionPane.showMessageDialog(map, ex.getMessage(), "", JOptionPane.ERROR_MESSAGE);
}*/
// Tip: Do not block UI thread.
geoprocessor.executeAsync(
gpInputParams,
new CallbackListener<GPParameter[]>() {
@Override
public void onError(Throwable th) {
th.printStackTrace();
}
@Override
public void onCallback(GPParameter[] result) {
updateProgresBarUI(null, tasksInProgress.decrementAndGet() > 0);
processResult(result);
}
}
);
}