/** * Inits the vector layer. */ private void initVectorLayer() { VectorOptions vectorOption = new VectorOptions(); vectorOption.setStyle(this.createStyle()); vectorOption.setDisplayInLayerSwitcher(false); this.vector = new Vector("Geofence PREVIEW Vector Layer", vectorOption); this.map.addLayer(vector); }
public JSObject getStyle(Style style) { return getJSObject().getProperty("style"); }
public void setStrategies(Strategy[] strategies){ for(int i=0, max=strategies.length; i < max;i++){ setStrategy(this.getJSObject(), strategies[i].getJSObject()); } }
public void setRenderers(String[] renderers) { for (int i = 0, max = renderers.length; i < max; i++) { setRenderer(this.getJSObject(), renderers[i]); } }
/** * Create a Vector layer from a geoJSOn file. * @param layerName The name you want to give to this layer. * @param url The URL to the geoJSON file you want to create a layer from. * @return A Vector layouer */ public static Vector createLayerFromJson(String layerName, String url) { FixedStrategyOptions fOptions = new FixedStrategyOptions(); FixedStrategy fStrategy = new FixedStrategy(fOptions); GeoJSON geoJson = new GeoJSON(); HTTPProtocolOptions httpProtOptions = new HTTPProtocolOptions(); httpProtOptions.setUrl(url); httpProtOptions.setFormat(geoJson); HTTPProtocol httpProt = new HTTPProtocol(httpProtOptions); VectorOptions options = new VectorOptions(); options.setStrategies(new Strategy[]{fStrategy}); options.setProtocol(httpProt); return new Vector(layerName, options); } }
public JSObject getStyleMap() { return getJSObject().getProperty("styleMap"); }
public void setStrategies(Strategy[] strategies) { this.strategies = strategies; for (int i = 0, max = strategies.length; i < max; i++) { setStrategy(this.getJSObject(), strategies[i].getJSObject()); } }
public void setGeometryType(String gtype) { getJSObject().setProperty("geometryType", gtype); }
@Override public void setIsBaseLayer(boolean b) { getJSObject().setProperty("isBaseLayer", b); }
public Vector(String name, VectorOptions options) { this(VectorImpl.create(name, options.getJSObject())); this.vectorOptions = options; }
public boolean getIsBaseLayer() { return getJSObject().getPropertyAsBoolean("isBaseLayer"); }
public void setGeometryType(String gtype) { getJSObject().setProperty("geometryType", gtype); }
public JSObject getRendererOptions() { return getJSObject().getProperty("rendererOptions"); }
public String getGeometryType() { return getJSObject().getPropertyAsString("geometryType"); }
public boolean getIsBaseLayer() { return getJSObject().getPropertyAsBoolean("isBaseLayer"); }
public JSObject getStyleMap() { return getJSObject().getProperty("styleMap"); }
public Vector(String name, VectorOptions options) { this(VectorImpl.create(name, options.getJSObject())); }
public void setIsBaseLayer(boolean b) { getJSObject().setProperty("isBaseLayer", b); }
public JSObject getStyle(Style style) { return getJSObject().getProperty("style"); }
public String getGeometryType() { return getJSObject().getPropertyAsString("geometryType"); }