Package com.gi.engine.carto

Examples of com.gi.engine.carto.Layer


          }
        }

        for (int i = 0, count = layerIds.size(); i < count; i++) {
          int layerId = Integer.valueOf(layerIds.get(i));
          Layer layer = map.getLayer(i);
          if (layer != null && layer instanceof FeatureLayer) {
            FeatureLayer featureLayer = (FeatureLayer) layer;
            try {
              QueryParam queryParam = new QueryParam();
              queryParam.setWhere(where);
View Full Code Here


          handleLayerIds.add(String.valueOf(i));
        }
      }

      for (int i = 0, count = handleLayerIds.size(); i < count; i++) {
        Layer layer = map.getLayer(i);

        QueryParam queryParam = new QueryParam();
        queryParam.setGeometry(geometry);
        queryParam.setSpatialFilterType(SpatialFilterType.INTERSECTS);
        FeatureCollection<? extends FeatureType, ? extends Feature> layerFeatureCollection = layer
            .query(queryParam);
        if (layerFeatureCollection != null
            && !layerFeatureCollection.isEmpty()) {
          for (FeatureIterator<? extends Feature> itr = layerFeatureCollection
              .features(); itr.hasNext();) {
View Full Code Here

        FeatureCollection<? extends FeatureType, ? extends Feature> featureCollection = null;
        MapServiceInstance instance = (MapServiceInstance) mapService
            .getMapServicePool().checkoutIdleInstance();
        try {
          Layer layer = instance.getMap().getLayer(nLayerId);
          if (featureIds != null) {
            featureCollection = layer.query(featureIds);
          } else {
            featureCollection = layer.query(queryParam);
          }
        } finally {
          if (instance != null) {
            mapService.getMapServicePool().checkinIdelInstance(
                instance);
View Full Code Here

        FeatureCollection<? extends FeatureType, ? extends Feature> featureCollection = null;
        MapServiceInstance instance = (MapServiceInstance) mapService
            .getMapServicePool().checkoutIdleInstance();
        try {
          Layer layer = instance.getMap().getLayer(layerId);
          featureCollection = layer.query(featureIds);
        } finally {
          if (instance != null) {
            mapService.getMapServicePool().checkinIdelInstance(
                instance);
          }
View Full Code Here

        boolean success = false;
        MapServiceInstance instance = (MapServiceInstance) mapService
            .getMapServicePool().checkoutIdleInstance();
        try {
          Layer layer = instance.getMap().getLayer(nLayerId);
          if (featureIds != null) {
            success = layer.delete(featureIds);
          } else {
            success = layer.delete(queryParam);
          }
        } finally {
          if (instance != null) {
            mapService.getMapServicePool().checkinIdelInstance(
                instance);
View Full Code Here

        FeatureType featureType = null;
        MapServiceInstance instance = (MapServiceInstance) mapService
            .getMapServicePool().checkoutIdleInstance();
        try {
          Layer layer = instance.getMap().getLayer(nLayerId);
          featureType = layer.getMapLayer().getFeatureSource()
              .getSchema();
        } finally {
          if (instance != null) {
            mapService.getMapServicePool().checkinIdelInstance(
                instance);
          }
        }

        // Handle features
        FeatureCollection<SimpleFeatureType, SimpleFeature> featureCollection = EsriJsonUtil
            .json2FeatureCollection(features,
                (SimpleFeatureType) featureType);

        instance = (MapServiceInstance) mapService.getMapServicePool()
            .checkoutIdleInstance();
        HashMap<FeatureId, Boolean> updates = null;
        try {
          Layer layer = instance.getMap().getLayer(nLayerId);
          updates = layer.update(featureCollection);
        } finally {
          if (instance != null) {
            mapService.getMapServicePool().checkinIdelInstance(
                instance);
          }
View Full Code Here

        FeatureCollection<? extends FeatureType, ? extends Feature> featureCollection = null;
        MapServiceInstance instance = (MapServiceInstance) mapService
            .getMapServicePool().checkoutIdleInstance();
        try {
          Layer layer = instance.getMap().getLayer(layerId);
          featureCollection = layer.query(featureIds);
        } finally {
          if (instance != null) {
            mapService.getMapServicePool().checkinIdelInstance(
                instance);
          }
View Full Code Here

        FeatureType featureType = null;
        MapServiceInstance instance = (MapServiceInstance) mapService
            .getMapServicePool().checkoutIdleInstance();
        try {
          Layer layer = instance.getMap().getLayer(nLayerId);
          featureType = layer.getMapLayer().getFeatureSource()
              .getSchema();
        } finally {
          if (instance != null) {
            mapService.getMapServicePool().checkinIdelInstance(
                instance);
          }
        }

        // Handle features
        FeatureCollection<SimpleFeatureType, SimpleFeature> addsFeatureCollection = null;
        if (adds != null) {
          addsFeatureCollection = EsriJsonUtil
              .json2FeatureCollection(adds,
                  (SimpleFeatureType) featureType);
        }
        FeatureCollection<SimpleFeatureType, SimpleFeature> updatesFeatureCollection = null;
        if (updates != null) {
          updatesFeatureCollection = EsriJsonUtil
              .json2FeatureCollection(updates,
                  (SimpleFeatureType) featureType);
        }
        String[] deleteFeatureIds = null;
        if (deletes != null) {
          deleteFeatureIds = deletes.split(",");
        }

        instance = (MapServiceInstance) mapService.getMapServicePool()
            .checkoutIdleInstance();

        List<FeatureId> addFeatureIds = null;
        HashMap<FeatureId, Boolean> updateFeatureIds = null;
        boolean deleteSuccess = false;
        try {
          Layer layer = instance.getMap().getLayer(nLayerId);

          try {
            addFeatureIds = layer.add(addsFeatureCollection);
          } catch (Exception ex) {
            ex.printStackTrace();
          }
          try {
            updateFeatureIds = layer
                .update(updatesFeatureCollection);
          } catch (Exception ex) {
            ex.printStackTrace();
          }
          try {
            deleteSuccess = layer.delete(deleteFeatureIds);
          } catch (Exception ex) {
            ex.printStackTrace();
          }
        } finally {
          if (instance != null) {
View Full Code Here

         
        FeatureType featureType = null;
        MapServiceInstance instance = (MapServiceInstance) mapService
            .getMapServicePool().checkoutIdleInstance();
        try {
          Layer layer = instance.getMap().getLayer(nLayerId);
          featureType = layer.getMapLayer().getFeatureSource()
              .getSchema();
        } finally {
          if (instance != null) {
            mapService.getMapServicePool().checkinIdelInstance(
                instance);
          }
        }

        // Handle features
        FeatureCollection<SimpleFeatureType, SimpleFeature> featureCollection = EsriJsonUtil
            .json2FeatureCollection(features,
                (SimpleFeatureType) featureType);

        instance = (MapServiceInstance) mapService.getMapServicePool()
            .checkoutIdleInstance();
        List<FeatureId> featureIds = null;
        try {
          Layer layer = instance.getMap().getLayer(nLayerId);
          featureIds = layer.add(featureCollection);
        } finally {
          if (instance != null) {
            mapService.getMapServicePool().checkinIdelInstance(
                instance);
          }
View Full Code Here

        FeatureCollection<? extends FeatureType, ? extends Feature> featureCollection = null;
        MapServiceInstance instance = (MapServiceInstance) mapService
            .getMapServicePool().checkoutIdleInstance();
        try {
          Layer layer = instance.getMap().getLayer(nLayerId);
          if (featureIds != null) {
            featureCollection = layer.query(featureIds);
          } else {
            featureCollection = layer.query(queryParam);
          }
        } finally {
          if (instance != null) {
            mapService.getMapServicePool().checkinIdelInstance(
                instance);
View Full Code Here

TOP

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

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.