Package org.gwtopenmaps.openlayers.client.util

Examples of org.gwtopenmaps.openlayers.client.util.JSObject


    // For example:
    // read(String vfString, WKTReadOptions options)
    // readToMap(String vfString, WKTReadOptions options)
    public VectorFeature[] read(String vectorFormatString)
    {
        JSObject out = FormatImpl.read(getJSObject(), vectorFormatString);
        JObjectArray jObjectArray = JObjectArray.narrowToJObjectArray(out.ensureOpaqueArray());
        int nr = jObjectArray.length();
        VectorFeature[] vfs = new VectorFeature[nr];
        for (int i = 0; i < nr; i++)
        {
            // get objects and narrow them to vector features
View Full Code Here


  public StyleOptions(){
    this(JSObject.createJSObject());
  }
   
    public void addContextStyleCallback(String id, ContextStyler styler) {
        JSObject context = getJSObject().getProperty("context");
        if (context == null) {
            getJSObject().setProperty("context", JSObject.createJSObject());
            context = getJSObject().getProperty("context");
        }
        context.setProperty(id, StyleOptionsImpl.createContextStylerCallback(styler));
    }
View Full Code Here

public class DrawFeatureOptions extends ControlOptions
{

    public void onFeatureAdded(FeatureAddedListener listener)
    {
        JSObject callback = DrawFeatureImpl.createFeatureAddedCallback(listener);
        getJSObject().setProperty("featureAdded", callback);
    }
View Full Code Here

        getJSObject().setProperty("standalone", standalone);
    }

    public void onModificationStart(OnModificationStartListener listener)
    {
        JSObject callback = ModifyFeatureImpl.createOnModificationStartCallback(listener);
        getJSObject().setProperty("onModificationStart", callback);
    }
View Full Code Here

        getJSObject().setProperty("onModificationStart", callback);
    }

    public void onModification(OnModificationListener listener)
    {
        JSObject callback = ModifyFeatureImpl.createOnModificationCallback(listener);
        getJSObject().setProperty("onModification", callback);
    }
View Full Code Here

        getJSObject().setProperty("onModification", callback);
    }

    public void onModificationEnd(OnModificationEndListener listener)
    {
        JSObject callback = ModifyFeatureImpl.createOnModificationEndCallback(listener);
        getJSObject().setProperty("onModificationEnd", callback);
    }
View Full Code Here

    }

    /** Creates a JS callback for a event type */
    private void createAndSetCallback(DragFeatureListener listener, String name)
    {
        JSObject callback = DragFeatureImpl.createDragCallback(listener);
        getJSObject().setProperty(name, callback);
    }
View Full Code Here

    /**
     *
     */
    public void setScales(float[] scales) {
        // does this work?
        JSObject scaleArray = JSObject.createJSArray().cast();
        for (int i = 0, max = scales.length; i < max; i++) {
            scaleArray.setProperty(Integer.toString(i), scales[i]);
        }
        getJSObject().setProperty("scales", scaleArray);
    }
View Full Code Here

    public Bounds() {
        this(BoundsImpl.create());
    }

    public double[] toArray() {
        JSObject boundsOpaque = BoundsImpl.toArray(getJSObject());
        JDoubleArray bounds = JDoubleArray.narrowToJDoubleArray(boundsOpaque);
        int boundsLength = bounds.length();
        double[] boundsCoordinates = new double[4];
        if (boundsLength == 4) {
            for (int i = 0; i < boundsLength; i++) {
View Full Code Here

     * @param origin default is center
     * @return a new bounds that is scaled by ratio from origin
     */
    public Bounds scale(float ratio,
            Pixel origin) {
        JSObject originJsObj = (origin == null) ? null : origin.getJSObject();
        return Bounds.narrowToBounds(BoundsImpl.scale(this.getJSObject(), ratio,
                                                      originJsObj));
    }
View Full Code Here

TOP

Related Classes of org.gwtopenmaps.openlayers.client.util.JSObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.