当前位置: 首页>>代码示例>>Java>>正文


Java Graphic.getSymbol方法代码示例

本文整理汇总了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); 
              } 
            } 
        ); */      
    }
 
开发者ID:Esri,项目名称:arcgis-runtime-demo-java,代码行数:54,代码来源:DemoTheatreApp.java

示例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); 
              } 
            } 
        );       
    }
 
开发者ID:Esri,项目名称:arcgis-runtime-demo-java,代码行数:54,代码来源:DemoTheatreAppImproved.java


注:本文中的com.esri.core.map.Graphic.getSymbol方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。