Search in sources :

Example 1 with JSObject

use of org.discotools.gwt.leaflet.client.jsobject.JSObject in project opennms by OpenNMS.

the class MarkerCluster method getAllChildMarkers.

public final List<JSNodeMarker> getAllChildMarkers() {
    final List<JSNodeMarker> markers = new ArrayList<JSNodeMarker>();
    final JsArray<JSObject> markerObjects = getMarkerObjects();
    if (markerObjects == null)
        return markers;
    for (int i = 0; i < markerObjects.length(); i++) {
        final JSObject markerObject = markerObjects.get(i);
        final JSNodeMarker marker = new JSNodeMarker(markerObject);
        markers.add(marker);
    }
    return markers;
}
Also used : ArrayList(java.util.ArrayList) JSObject(org.discotools.gwt.leaflet.client.jsobject.JSObject) JSNodeMarker(org.opennms.features.vaadin.nodemaps.internal.gwt.client.JSNodeMarker)

Example 2 with JSObject

use of org.discotools.gwt.leaflet.client.jsobject.JSObject in project opennms by OpenNMS.

the class JSNodeMarker method setCategories.

public void setCategories(final String[] categories) {
    final JsArrayString array = JsArrayString.createArray().cast();
    for (final String category : categories) {
        array.push(category);
    }
    final JSObject jsObject = array.cast();
    getJSObject().setProperty(Property.CATEGORIES, jsObject);
}
Also used : JSObject(org.discotools.gwt.leaflet.client.jsobject.JSObject) JsArrayString(com.google.gwt.core.client.JsArrayString) JsArrayString(com.google.gwt.core.client.JsArrayString)

Example 3 with JSObject

use of org.discotools.gwt.leaflet.client.jsobject.JSObject in project opennms by OpenNMS.

the class MarkerClusterGroup method addLayers.

public MarkerClusterGroup addLayers(final List<ILayer> layers) {
    final JsArray<JSObject> layerArray = JsArray.createArray().cast();
    for (final ILayer marker : layers) {
        layerArray.push(marker.getJSObject());
    }
    MarkerClusterGroupImpl.addLayers(getJSObject(), layerArray);
    return this;
}
Also used : ILayer(org.discotools.gwt.leaflet.client.layers.ILayer) JSObject(org.discotools.gwt.leaflet.client.jsobject.JSObject)

Aggregations

JSObject (org.discotools.gwt.leaflet.client.jsobject.JSObject)3 JsArrayString (com.google.gwt.core.client.JsArrayString)1 ArrayList (java.util.ArrayList)1 ILayer (org.discotools.gwt.leaflet.client.layers.ILayer)1 JSNodeMarker (org.opennms.features.vaadin.nodemaps.internal.gwt.client.JSNodeMarker)1