Hi Francois, My advice is pretty much the same. Go back to the old code and use GWT Development Mode with a debugger to trace through and see where things were going wrong. You might try putting a try/catch around all of your code in the click handler to catch the problem more easily.
On Thu, Dec 17, 2009 at 1:26 PM, Francois <[email protected]> wrote: > Hello Eric > > Thanks for the reply, please refer to this post of mine. Where I've > managed to fix the problem. However I have an couple of questions > about the issue at hand. > > > http://groups.google.com/group/google-web-toolkit/browse_thread/thread/85674e6db8e97d1a# > > On Dec 17, 4:17 pm, Eric Ayers <[email protected]> wrote: > > Hello pfdevil, > > > > Set a breakpoint in your MapClickHandler instance with a Java debugger > (like > > running in Debug mode in Eclipse) to get a handle on what your code is > > doing. I see one odd thing. Although it isn't necessarily wrong, > you're > > creating a new marker every time the handler goes off. You may find that > an > > exception is happening inside the handler before you get a chance to > remove > > the overlay. > > > > -Eric. > > > > > > > > On Thu, Dec 17, 2009 at 8:50 AM, pfdevil <[email protected]> > wrote: > > > Hello > > > > > I have an issue with an marker that does not want to closed when > > > clicked. I copied the code from this tutorial. > > > > >http://gwt.google.com/samples/HelloMaps-1.0.1/HelloMaps.html#Click%20. > .. > > > > > Here is my code: > > > > > public class SimpleMaps implements EntryPoint{ > > > private InfoWindow info = null; > > > private Marker newMarker = null; > > > InfoWindowContent infoWindowContent = null; > > > > > /** > > > * This is the entry point method. > > > */ > > > public void onModuleLoad() { > > > LatLng cawkrCity = LatLng.newInstance(39.509, -98.434); > > > VerticalPanel verticalPanel = new VerticalPanel(); > > > > > verticalPanel.addStyleName("verticalPanel"); > > > > > MapWidget map = new MapWidget(cawkrCity, 4); > > > > > HTML htmlWidget = new HTML("<b> Write a message </b>"); > > > > > verticalPanel.add(htmlWidget); > > > > > info = map.getInfoWindow(); > > > > > infoWindowContent = new InfoWindowContent(verticalPanel); > > > > > map.setUIToDefault(); > > > > > map.addStyleName("mapContainer"); > > > > > map.setSize("500px", "300px"); > > > > > map.addMapClickHandler(new MapClickHandler() { > > > public void onClick(MapClickEvent e) { > > > MapWidget sender = e.getSender(); > > > Overlay overlay = e.getOverlay(); > > > LatLng point = e.getLatLng(); > > > > > newMarker = new Marker(point); > > > > > if (overlay != null && overlay instanceof Marker) { > > > sender.removeOverlay(overlay); > > > > > } else { > > > sender.addOverlay(newMarker); > > > info.open(newMarker, infoWindowContent); > > > > > } > > > } > > > }); > > > > > RootPanel.get("mapContainer").add(map); > > > > > } > > > > > } > > > > > -- > > > > > You received this message because you are subscribed to the Google > Groups > > > "Google Web Toolkit" group. > > > To post to this group, send email to > [email protected]. > > > To unsubscribe from this group, send email to > > > [email protected]<google-web-toolkit%[email protected]> > <google-web-toolkit%[email protected]<google-web-toolkit%[email protected]> > > > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/google-web-toolkit?hl=en. > > > > -- > > Eric Z. Ayers > > Google Web Toolkit, Atlanta, GA USA > > -- > > You received this message because you are subscribed to the Google Groups > "Google Web Toolkit" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-web-toolkit%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-web-toolkit?hl=en. > > > -- Eric Z. Ayers Google Web Toolkit, Atlanta, GA USA -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
