Example #1
0
 public Layer[] getLayers() {
   JSObject jsObjects = MapImpl.getLayers(getJSObject());
   JObjectArray jObjectArray = JObjectArray.narrowToJObjectArray(jsObjects);
   Layer[] layers = new Layer[jObjectArray.length()];
   for (int i = 0; i < jObjectArray.length(); i++) {
     layers[i] = Layer.narrowToLayer(jObjectArray.get(i));
   }
   return layers;
 }
Example #2
0
  public void addLayers(Layer[] layers) {
    JSObject[] jsObjects = new JSObject[layers.length];
    for (int i = 0; i < layers.length; i++) {
      jsObjects[i] = layers[i].getJSObject();
    }

    JObjectArray array = new JObjectArray(jsObjects);
    MapImpl.addLayers(getJSObject(), array.getJSObject());
  }
Example #3
0
 public void setCenter(LonLat lonlat) {
   MapImpl.setCenter(getJSObject(), lonlat.getJSObject());
 }
Example #4
0
 /**
  * Set the min and max zoomlevel of the map. This blocks zooming further out or in than the given
  * levels.
  *
  * @param minZoomLevel The minlevel to zoom
  * @param maxZoomLevel The maxlevel to zoom
  */
 public void setMinMaxZoomLevel(int minZoomLevel, int maxZoomLevel) {
   MapImpl.setMinMaxZoomLevel(getJSObject(), minZoomLevel, maxZoomLevel);
 }
Example #5
0
 /** zoom in with one step. */
 public void zoomIn() {
   MapImpl.zoomIn(getJSObject());
 }
Example #6
0
 public void disableBrowserContextMenu(BrowserMenuListener listener) {
   MapImpl.disableBrowserContextMenu(getJSObject(), listener);
 }
Example #7
0
 Map(Element e) {
   super(MapImpl.create(e));
 }
Example #8
0
 /**
  * This function should be called by any external code which dynamically changes the size of the
  * map div. It can also be called when experiencing the problem of the single small tile in the
  * upper left corner (doesn't work in all situations thought)
  */
 public void updateSize() {
   MapImpl.updateSize(getJSObject());
 }
Example #9
0
 public void zoomTo(int zoomLevel) {
   MapImpl.zoomTo(getJSObject(), zoomLevel);
 }
Example #10
0
 public void raiseLayer(Layer layer, int delta) {
   MapImpl.raiseLayer(getJSObject(), layer.getJSObject(), delta);
 }
Example #11
0
 public double getScale() {
   return MapImpl.getScale(getJSObject());
 }
Example #12
0
 public Bounds getMaxExtent() {
   return new Bounds(MapImpl.getMaxExtent(getJSObject()));
 }
Example #13
0
 /**
  * See also {@link MapUnits}.
  *
  * @return String - the units used by the projection
  */
 public String getUnits() {
   return MapImpl.getUnits(getJSObject());
 }
Example #14
0
 public String getProjection() {
   return MapImpl.getProjection(getJSObject());
 }
Example #15
0
 /**
  * Method: getLonLatFromLayerPx
  *
  * <p>Parameters:
  *
  * @param px - {<OpenLayers.Pixel>}
  * @return {<OpenLayers.LonLat>}
  */
 public LonLat getLonLatFromLayerPx(Pixel px) {
   return new LonLat(MapImpl.getLonLatFromLayerPx(getJSObject(), px.getJSObject()));
 }
Example #16
0
 public double getZoomForResolution(double resolution, boolean closest) {
   return MapImpl.getZoomForResolution(getJSObject(), resolution, closest);
 }
Example #17
0
 public void setBaseLayer(Layer newBaseLayer) {
   MapImpl.setBaseLayer(getJSObject(), newBaseLayer.getJSObject());
 }
Example #18
0
 public void zoomToScale(float scale, boolean closest) {
   MapImpl.zoomToScale(getJSObject(), scale, closest);
 }
Example #19
0
 public void destroy() {
   MapImpl.destroy(getJSObject());
 }
Example #20
0
 public void zoomToMaxExtent() {
   MapImpl.zoomToMaxExtent(getJSObject());
 }
Example #21
0
 Map(Element e, MapOptions options) {
   super(MapImpl.create(e, options.getJSObject()));
 }
Example #22
0
 public void setOptions(MapOptions mapOptions) {
   MapImpl.setOptions(getJSObject(), mapOptions.getJSObject());
 }
Example #23
0
 /**
  * returns the DOM node of the viewport.
  *
  * @return
  */
 public Element getViewport() {
   return MapImpl.getViewport(getJSObject());
 }
Example #24
0
 public void panTo(LonLat lonlat) {
   MapImpl.panTo(getJSObject(), lonlat.getJSObject());
 }
Example #25
0
 /** zoom out with one step. */
 public void zoomOut() {
   MapImpl.zoomOut(getJSObject());
 }
Example #26
0
 public void pan(int dx, int dy) {
   MapImpl.pan(getJSObject(), dx, dy);
 }
Example #27
0
 /** @return LonLat - the coordinates of the center */
 public LonLat getCenter() {
   return new LonLat(MapImpl.getCenter(getJSObject()));
 }
Example #28
0
 public Size getSize() {
   return new Size(MapImpl.getSize(getJSObject()));
 }
Example #29
0
 public void setCenter(LonLat lonlat, int zoom) {
   MapImpl.setCenter(getJSObject(), lonlat.getJSObject(), zoom);
 }
Example #30
0
 public double getMaxResolution() {
   return MapImpl.getMaxResolution(getJSObject());
 }