Esempio n. 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;
 }
Esempio n. 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());
  }