Hello,
I am experiencing a weird behavior from JsInterop in this project:
gwty-leafle <https://github.com/gwidgets/gwty-leaflet>t. The Map
<https://github.com/gwidgets/gwty-leaflet/blob/master/src/main/java/com/gwidgets/api/leaflet/Map.java>
class has a zoomIn(Number delta) method that is supposed to zoom in the map
with the specified delta. This method works fine in javascript:
var mymap = L.map('map', {
center: [51.505, -0.09],
zoom: 13,
minZoom: 5,
maxZoom: 400
}
);
console.log(mymap.getZoom());
console.log(mymap.getMinZoom());
console.log(mymap.getMaxZoom());
mymap.zoomIn(20);
// Give 33
console.log("after zoom" + mymap.getZoom());
However, in the JsInterop version the result is different, and after using
zoomIn() with any delta, the zoom jumps directly to the maxZoom value which
is odd:
LeafletResources.whenReady(
e ->
{
//Map options required values: center point, zoom, and a min zoom
MapOptions options = new MapOptions.Builder(L.latLng(51.505, -0.09), 13,
5)
.maxZoom(400).build();
final Map map = L.map("map", options);
//Same as javascript
GWT.log(map.getZoom());
GWT.log(map.getMinZoom());
GWT.log(map.getMaxZoom());
map.zoomIn(33, null);
// result is 400 -> jumps straight to maxZoom
GWT.log("after zoom"+map.getZoom());
});
The same thing happens with the Transformation
<https://github.com/gwidgets/gwty-leaflet/blob/master/src/test/java/com/gwidgets/leaflet/test/TransformationTest.java>
class.
Any help is much appreciated.
--
You received this message because you are subscribed to the Google Groups "GWT
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.