Tuesday, February 4, 2014

Re: Using JSNI to create Labeled Marker cause Object function MarkerLabel_(marker, crossURL, handCursorURL){ …} has no method 'getSharedCross'

I was having the same exact issues but got it work when mimicking 
http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerwithlabel/1.1.8/examples/basic.html 
as close as possible.. i.e.
i was loading the external libraries via in JavaScript..  i.e.
            window.onload = loadScript(); 
I changed them to these: 
        <script type=""text/javascript"" src=""http://maps.googleapis.com/maps/api/js?v=3&amp;sensor=false""></script>
        <script type=""text/javascript"" src=""http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerwithlabel/1.1.8/src/markerwithlabel.js""></script>

now it works for me.... 


On Saturday, January 5, 2013 11:57:20 PM UTC-5, bon...@gmail.com wrote:
I tried to create a Label Marker by using JSNI to call google-maps-utility-library-v3 's markerwithlabel.js . However, I always receive this exception :

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'

Here is the JSNI method I have created :

    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); }-*/; 
 
 

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment