示例#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;
 }
示例#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());
  }
示例#3
0
 public void setCenter(LonLat lonlat) {
   MapImpl.setCenter(getJSObject(), lonlat.getJSObject());
 }
示例#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);
 }
示例#5
0
 /** zoom in with one step. */
 public void zoomIn() {
   MapImpl.zoomIn(getJSObject());
 }
示例#6
0
 public void disableBrowserContextMenu(BrowserMenuListener listener) {
   MapImpl.disableBrowserContextMenu(getJSObject(), listener);
 }
示例#7
0
 Map(Element e) {
   super(MapImpl.create(e));
 }
示例#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());
 }
示例#9
0
 public void zoomTo(int zoomLevel) {
   MapImpl.zoomTo(getJSObject(), zoomLevel);
 }
示例#10
0
 public void raiseLayer(Layer layer, int delta) {
   MapImpl.raiseLayer(getJSObject(), layer.getJSObject(), delta);
 }
示例#11
0
 public double getScale() {
   return MapImpl.getScale(getJSObject());
 }
示例#12
0
 public Bounds getMaxExtent() {
   return new Bounds(MapImpl.getMaxExtent(getJSObject()));
 }
示例#13
0
 /**
  * See also {@link MapUnits}.
  *
  * @return String - the units used by the projection
  */
 public String getUnits() {
   return MapImpl.getUnits(getJSObject());
 }
示例#14
0
 public String getProjection() {
   return MapImpl.getProjection(getJSObject());
 }
示例#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()));
 }
示例#16
0
 public double getZoomForResolution(double resolution, boolean closest) {
   return MapImpl.getZoomForResolution(getJSObject(), resolution, closest);
 }
示例#17
0
 public void setBaseLayer(Layer newBaseLayer) {
   MapImpl.setBaseLayer(getJSObject(), newBaseLayer.getJSObject());
 }
示例#18
0
 public void zoomToScale(float scale, boolean closest) {
   MapImpl.zoomToScale(getJSObject(), scale, closest);
 }
示例#19
0
 public void destroy() {
   MapImpl.destroy(getJSObject());
 }
示例#20
0
 public void zoomToMaxExtent() {
   MapImpl.zoomToMaxExtent(getJSObject());
 }
示例#21
0
 Map(Element e, MapOptions options) {
   super(MapImpl.create(e, options.getJSObject()));
 }
示例#22
0
 public void setOptions(MapOptions mapOptions) {
   MapImpl.setOptions(getJSObject(), mapOptions.getJSObject());
 }
示例#23
0
 /**
  * returns the DOM node of the viewport.
  *
  * @return
  */
 public Element getViewport() {
   return MapImpl.getViewport(getJSObject());
 }
示例#24
0
 public void panTo(LonLat lonlat) {
   MapImpl.panTo(getJSObject(), lonlat.getJSObject());
 }
示例#25
0
 /** zoom out with one step. */
 public void zoomOut() {
   MapImpl.zoomOut(getJSObject());
 }
示例#26
0
 public void pan(int dx, int dy) {
   MapImpl.pan(getJSObject(), dx, dy);
 }
示例#27
0
 /** @return LonLat - the coordinates of the center */
 public LonLat getCenter() {
   return new LonLat(MapImpl.getCenter(getJSObject()));
 }
示例#28
0
 public Size getSize() {
   return new Size(MapImpl.getSize(getJSObject()));
 }
示例#29
0
 public void setCenter(LonLat lonlat, int zoom) {
   MapImpl.setCenter(getJSObject(), lonlat.getJSObject(), zoom);
 }
示例#30
0
 public double getMaxResolution() {
   return MapImpl.getMaxResolution(getJSObject());
 }