Package com.gi.engine.carto

Examples of com.gi.engine.carto.MapDesc


        this.mapDirPath = jFileChooser.getSelectedFile()
            .getAbsolutePath();

        this.getMap().dispose();

        this.mapDesc = new MapDesc();
        this.getMap().initByMapDesc(mapDesc, getMapDescFilePath());
        this.setMapContext(new DefaultMapContext());
        this.getMapPane().setBackground(mapDesc.getBackgroundColor());
        this.repaint();
View Full Code Here


  private String generateJSONResult(MapService mapService) {
    String result = null;

    try {
      MapDesc mapDesc = mapService.getMapDesc();
      String mapName = mapDesc.getName();

      JSONObject obj = new JSONObject();
      JSONObject objSR = null;
      JSONObject objTemp = null;
      JSONArray arrayTemp = null;

      obj.put("GIServerVersion", VersionUtil.getCurrentversion());
      obj.put("name", mapName);

      arrayTemp = new JSONArray();
      for (int i = 0, count = mapDesc.getLayerInfos().size(); i < count; i++) {
        LayerInfo layerInfo = mapDesc.getLayerInfo(i);
        if (layerInfo.isEditable()) {
          objTemp = new JSONObject();
          objTemp.put("id", i);
          objTemp.put("name", layerInfo.getName());
          arrayTemp.put(objTemp);
        }
      }
      obj.put("layers", arrayTemp);

      objSR = new JSONObject();
      objSR.put("wkid", mapDesc.getWkid());
      obj.put("spatialReference", objSR);

      result = obj.toString();
    } catch (Exception ex) {
      ex.printStackTrace();
View Full Code Here

    try {
      MapService mapService = ServiceManager.getMapService(serviceName);

      if (mapService != null) {
        MapDesc mapDesc = mapService.getMapDesc();
        MapServiceDesc mapServiceDesc = mapService.getMapServiceDesc();
        if (mapServiceDesc.isNeedToken()) {
          if (!TokenService.verifyToken(token)
              && !("html".equals(f) && geometry == null)) {
            return TokenService.TOKEN_INVALID_TIP;
          }
        }

        // Handle geometry
        Geometry identifyGeometry = EsriJsonUtil
            .json2Geometry(geometry);

        // Handle SRs
        String mapSR = mapDesc.getWkid();
        if (sr == null || "".equals(sr)) {
          sr = mapSR;
        }
        if (!sr.equals(mapSR)) {
          identifyGeometry = GeometryToolkit.project(
              identifyGeometry, sr, mapSR);
        }

        // Handle layers
        IdentifyType identifyType = IdentifyType.TOP;
        ArrayList<String> layerIds = new ArrayList<String>();
        if (layers != null && !"".equals(layers)) {
          String type = null;
          String ids = layers;
          if (layers.indexOf(":") > 0) {
            String[] str = layers.split(":");
            type = str[0];
            ids = str[1];
            if (ids != null && !"".equals(ids)) {
              try {
                String[] strLayers = ids.split(",");
                int layerCount = strLayers.length;
                for (int i = 0; i < layerCount; i++) {
                  layerIds.add(strLayers[i]);
                }
              } catch (Exception ex) {
                ex.printStackTrace();
              }
            }
          } else {
            type = layers;
            for (int i = 0, count = mapDesc.getLayerInfos().size(); i < count; i++) {
              layerIds.add(String.valueOf(i));
            }
          }

          if ("top".equals(type.toLowerCase())) {
View Full Code Here

    try {
      MapService mapService = (MapService) pool.getParentService();
      serviceName = mapService.getServiceName();

      MapDesc mapDesc = mapService.getMapDesc();
      map = new Map();
      map.initByMapDesc(mapDesc, mapService.getServiceDir()
          + ArchitectureUtil.MAP_DESC_FILE_NAME);
    } catch (Exception e) {
      StringBuilder sb = new StringBuilder();
View Full Code Here

    try {
      this.startTimeoutMonitor();

      MapService mapService = (MapService) this.getParentPool()
          .getParentService();
      MapDesc mapDesc = mapService.getMapDesc();

      String mapSR = mapDesc.getWkid();

      // Handle geometry
      Geometry geometry = identifyParam.getGeometry();
      int tolerance = identifyParam.getTolerance();
      double resolution = identifyParam.getResolution();
View Full Code Here

    try {
      MapService mapService = ServiceManager.getMapService(serviceName);

      if (mapService != null) {
        MapDesc mapDesc = mapService.getMapDesc();
        MapServiceDesc mapServiceDesc = mapService.getMapServiceDesc();
        if (mapServiceDesc.isNeedToken()) {
          boolean htmlNoParams = "html".equals(f)
              && objectIds == null && geometry == null
              && geometryType == null && inSR == null
              && spatialRel == null && where == null
              && outFields == null && outSR == null;
          if (!TokenService.verifyToken(token) && !htmlNoParams) {
            return TokenService.TOKEN_INVALID_TIP;
          }
        }

        // Handle layerId
        int nLayerId = Integer.parseInt(layerId);

        // Handle SRs
        String sr = mapDesc.getWkid();
        if (inSR == null || "".equals(inSR)) {
          inSR = sr;
        }
        if (outSR == null || "".equals(outSR)) {
          outSR = sr;
View Full Code Here

  private String generateJSONResult(MapService mapService) {
    String result = null;

    try {
      MapDesc mapDesc = mapService.getMapDesc();
      MapServiceDesc mapServiceDesc = mapService.getMapServiceDesc();
      String mapName = mapDesc.getName();

      JSONObject obj = new JSONObject();
      JSONObject objSR = null;
      JSONObject objTemp = null;
      JSONObject objTemp2 = null;
      JSONArray arrayTemp = null;

      obj.put("GIServerVersion", VersionUtil.getCurrentversion());
      obj.put("name", mapName);
      obj.put("maxInstances", mapServiceDesc.getMaxInstances());
      obj.put("maxResults", mapServiceDesc.getMaxResults());

      arrayTemp = new JSONArray();
      for (int i = 0, count = mapDesc.getLayerInfos().size(); i < count; i++) {
        LayerInfo layerInfo = mapDesc.getLayerInfo(i);
        objTemp = new JSONObject();
        objTemp.put("id", i);
        objTemp.put("name", layerInfo.getName());
        objTemp.put("defaultVisibility", layerInfo.isVisible());
        objTemp.put("editable", layerInfo.isEditable());
        arrayTemp.put(objTemp);
      }
      obj.put("layers", arrayTemp);

      objSR = new JSONObject();
      try {
        Integer.parseInt(mapDesc.getWkid());
        objSR.put("wkid", Integer.valueOf(mapDesc.getWkid()));
      } catch (NumberFormatException e) {
        objSR.put("wkid", mapDesc.getWkid());
      }
      obj.put("spatialReference", objSR);

      objTemp = new JSONObject();
      Envelope initialExtent = mapDesc.getInitialExtent();
      objTemp.put("xmin", initialExtent.getMinX());
      objTemp.put("xmax", initialExtent.getMaxX());
      objTemp.put("ymin", initialExtent.getMinY());
      objTemp.put("ymax", initialExtent.getMaxY());
      objTemp.put("spatialReference", objSR);
View Full Code Here

    String result = "";

    try {
      String contextRoot = context.getContextPath();

      MapDesc mapDesc = mapService.getMapDesc();
      MapServiceDesc mapServiceDesc = mapService.getMapServiceDesc();
      String mapName = mapDesc.getName();
      String serviceName = mapService.getServiceName();

      StringBuilder sb = new StringBuilder();
      sb.append("<b>Layers: </b>");
      sb.append("<ul>");
      int layerCount = mapDesc.getLayerInfos().size();
      for (int i = 0; i < layerCount; i++) {
        LayerInfo layerInfo = mapDesc.getLayerInfo(i);
        sb.append("<li><a href='" + contextRoot
            + "/rest/service/MapService/" + serviceName + "/" + i
            + "'>" + layerInfo.getName() + "</a>(" + i + ")</li>");
        sb.append(layerInfo.isVisible() ? "[visible]" : "");
        sb.append(layerInfo.isEditable() ? "[editable]" : "");
      }
      sb.append("</ul>");

      sb.append("<b>SpatialReference: </b>");
      sb.append(mapDesc.getWkid());
      sb.append("<br/><br/>");

      Envelope initialExtent = mapDesc.getInitialExtent();
      sb.append("<b>Initial Extent: </b>");
      sb.append("<br/>xmin: " + initialExtent.getMinX());
      sb.append("<br/>xmax: " + initialExtent.getMaxX());
      sb.append("<br/>ymin: " + initialExtent.getMinY());
      sb.append("<br/>ymax: " + initialExtent.getMaxY());
View Full Code Here

    String result = "";

    try {
      String contextRoot = context.getContextPath();

      MapDesc mapDesc = mapService.getMapDesc();
      String mapName = mapDesc.getName();
      String serviceName = mapService.getServiceName();

      StringBuilder sb = new StringBuilder();
      sb.append("<b>Layers: </b>");
      sb.append("<ul>");
      int layerCount = mapDesc.getLayerInfos().size();
      for (int i = 0; i < layerCount; i++) {
        LayerInfo layerInfo = mapDesc.getLayerInfo(i);
        sb.append("<li><a href='" + contextRoot
            + "/rest/service/FeatureService/" + serviceName + "/" + i
            + "'>" + layerInfo.getName() + "</a>(" + i + ")</li>");
        sb.append(layerInfo.isEditable() ? "[editable]" : "");
      }
View Full Code Here

        }

        // Handle layerId
        int nLayerId = Integer.parseInt(layerId);

        MapDesc mapDesc = mapService.getMapDesc();
        boolean editable = mapDesc.getLayerInfo(nLayerId).isEditable();
        if (!editable) {
          return null;
        }

        // Handle SRs
        String sr = mapDesc.getWkid();
        if (inSR == null || "".equals(inSR)) {
          inSR = sr;
        }

        String[] featureIds = null;
View Full Code Here

TOP

Related Classes of com.gi.engine.carto.MapDesc

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.