我尝试通过使用JSNI调用google-maps-utility-library-v3 的 markerwithlabel.js来创建标签标记。但是,我总是收到此异常:
com.google.gwt.core.client.JavaScriptException: (TypeError) @com.gwt.map.client.GWTMap::setLabeledMarker(Lcom/google/gwt/maps/client/base/LatLng;Lcom/google/gwt/maps/client/MapImpl;)([JavaScript object(51), JavaScript object(19)]): Object function MarkerLabel_(marker, crossURL, handCursorURL){ ...} has no method 'getSharedCross'
这是我创建的 JSNI 方法:
public final native void setLabeledMarker(LatLng ll,MapImpl myMap)
/*-{
var marker = new $wnd.MarkerWithLabel({
position: ll,
draggable: true,
raiseOnDrag: true,
labelContent: "Hello",
labelAnchor: new $wnd.google.maps.Point(22, 0),
labelClass: "labels", // the CSS class for the label
labelStyle: {opacity: 1.0}
});
marker.setMap(myMap);
}-*/;
我正在使用Branflake 的 GWT Map 版本 3.8.1和google-maps-utility-library-v3 的 markerwithlabel.js
请给我你的建议