public static Projection narrowToProjection(JSObject projection) { return new Projection(projection); } }
/** * * @return String - projection code, see {@link #Projection(String)}. */ public String getProjectionCode(String projectionCode){ return ProjectionImpl.getProjectionCode(getJSObject()); }
public Projection getProjection() { return Projection.narrowToProjection(LayerImpl.getProjection( getJSObject())); }
/** * Translate the x,y properties of the geometry from source to dest. * * @param source * @param dest */ public void transform(Projection source, Projection dest) { GeometryImpl.transform(getJSObject(), source.getJSObject(), dest.getJSObject()); } }
private void initializeDefaultMapOptions() { defaultMapOptions.setMaxResolutionToAuto(); defaultMapOptions.setNumZoomLevels(18); defaultMapOptions.setUnits(MapUnits.DEGREES); defaultMapOptions.setDisplayProjection(new Projection(DISPLAY_PROJECTION)); }
/** * * @return String - projection code, see {@link #Projection(String)}. */ public String getProjectionCode() { return ProjectionImpl.getProjectionCode(getJSObject()); }
/** * Draw aoi on map. * * @param wkt * the wkt */ public void drawAoiOnMap(String wkt) { this.eraseFeatures(); MultiPolygon geom = MultiPolygon.narrowToMultiPolygon(Geometry.fromWKT(wkt).getJSObject()); geom.transform(new Projection("EPSG:4326"), new Projection("EPSG:900913")); VectorFeature vectorFeature = new VectorFeature(geom); this.vector.addFeature(vectorFeature); this.map.zoomToExtent(geom.getBounds()); }
@Override public void transform(Projection source, Projection dest) { CollectionImpl.transform(getJSObject(), source.getJSObject(), dest.getJSObject()); }
/** * Creates the map option. * * @param isGoogle * the is google */ private void createMapOption(boolean isGoogle) { // TODO Auto-generated method stub OpenLayers.setProxyHost("gwtOpenLayersProxy?targetURL="); this.defaultMapOptions = new MapOptions(); this.defaultMapOptions.setNumZoomLevels(18); if (isGoogle) { this.defaultMapOptions.setProjection("EPSG:900913"); this.defaultMapOptions.setDisplayProjection(new Projection("EPSG:4326")); this.defaultMapOptions.setUnits(MapUnits.METERS); this.defaultMapOptions.setMaxExtent(new Bounds(-20037508, -20037508, 20037508, 20037508.34)); this.defaultMapOptions.setMaxResolution(new Double(156543.0339).floatValue()); } else { this.defaultMapOptions.setProjection("EPSG:4326"); } initMapWidget(this.defaultMapOptions, isGoogle); }
/** * Translate the x,y properties of the point from source to dest. * * @param source * @param dest */ public void transform(Projection source, Projection dest) { PointImpl.transform(getJSObject(), source.getJSObject(), dest.getJSObject()); }
public Bounds transform(Projection source, Projection dest) { return Bounds.narrowToBounds(BoundsImpl.transform(getJSObject(), source.getJSObject(), dest.getJSObject())); }
/** * * @param projection */ public void setExternalProjection(Projection projection){ getJSObject().setProperty("externalProjection", projection.getJSObject()); };
/** * Use this method to change the display projection * to another projection. * * @param projection */ public void setDisplayProjection(Projection projection) { getJSObject().setProperty("displayProjection", projection.getJSObject()); }
/** * Use this method to change the display projection * to another projection. * * @param projection */ public void setDisplayProjection(Projection projection) { getJSObject().setProperty("displayProjection", projection.getJSObject()); }
/** * * @param projection */ public void setInternalProjection(Projection projection){ getJSObject().setProperty("internalProjection", projection.getJSObject()); };
public double getGeodesicArea(Projection projection) { return PolygonImpl.getGeodesicArea(getJSObject(), projection.getJSObject()); }
/** * Projection used when reading the coordinates from the URL, requires proj4js support. * * This will reproject the map coordinates from the URL into the map’s projection. If * you are using this functionality, be aware that any permalink which is added to the * map will determine the coordinate type which is read from the URL, which means you * should not add permalinks with different displayProjections to the same map. * (from OL docs) * @param displayProjection */ public void setDisplayProjection(Projection displayProjection) { getJSObject().setProperty("displayProjection", displayProjection.getJSObject()); }
/** * APIProperty: internalProjection {@link Projection}. When passed a * externalProjection and internalProjection, the format will reproject the * geometries it reads or writes. The internalProjection is the projection * used by the geometries which are returned by read or which are passed * into write. In order to reproject, a projection transformation function * for the specified projections must be available. This support may be * provided via proj4js or via a custom transformation function. See * {<OpenLayers.Projection.addTransform>} for more information on custom * transformations. * * @param projection */ public void setInternalProjection(Projection projection) { getJSObject().setProperty("internalProjection", projection.getJSObject()); }
/** * APIProperty: externalProjection {@link Projection}. When passed a * externalProjection and internalProjection, the format will reproject the * geometries it reads or writes. The externalProjection is the projection * used by the content which is passed into read or which comes out of * write. In order to reproject, a projection transformation function for * the specified projections must be available. This support may be provided * via proj4js or via a custom transformation function. See * {<OpenLayers.Projection.addTransform>} for more information on custom * transformations. * * @param projection */ public void setExternalProjection(Projection projection) { getJSObject().setProperty("externalProjection", projection.getJSObject()); }
/** * APIMethod: getGeodesicLength Calculate the approximate length of the * geometry were it projected onto the earth. * * projection - {@link Projection} The spatial reference system for the * geometry coordinates. If not provided, Geographic/WGS84 is assumed. * * Returns: {double} The appoximate geodesic length of the geometry in * meters. */ public double getGeodesicLength(Projection projection) { return (projection != null) ? CurveImpl.getGeodesicLength(getJSObject(), projection.getJSObject()) : CurveImpl.getGeodesicLength( getJSObject(), null); }