/*
* Creates a polyline from an array of vertices. The color is given as
a string that contains the color in hexadecimal numeric HTML style,
i.e. #RRGGBB. The weight is the width of the line in pixels. The
opacity is given as a number between 0 and 1. The line will be
antialiased and semitransparent.
*/
public static native GPolyline create(GLatLng[] points)/*-{
var length =
points.@[Lcom/mapitz/gwt/googleMaps/client/GLatLng;::length;
$wnd.alert(length);
return new $wnd.GPolyline(points);
}-*/;
-= Mat
public static JavaScriptObject arrayConvert(Object[] array)
{
JavaScriptObject result = newJSArray(array.length);
for (int i = 0; i < array.length; i++)
{
arraySet(result, i, array[i]);
}
return result;
}
private static native JavaScriptObject newJSArray(int length) /*-{
if (length < 0)
{
return new Array();
}
else
{
return new Array(length);
}
}-*/;
public static native int arrayLength(JavaScriptObject array) /*-{
return array.length;
}-*/;
public static native Object arrayGetObject(JavaScriptObject array, int
index) /*-{
return array[index];
}-*/;
public static native void arraySet(JavaScriptObject array, int index,
Object value) /*-{
array[index] = value;
}-*/;
Thanks for the code sample, it works well.
Cheers,
Anthony