My html file has following line to include map script. <script src="http://maps.google.com/maps? gwt=1&file=api&v=2.180&sensor=false&key=ABQIAAAAgzqoAc5zEXZHNhhpG4fd1hRZ1Sxt3f56U- xS8irZ2VC0xL5YrhS1DRR3NtzTpP8LxVHTxcRDA4Sn-Q" />
On Nov 24, 10:24 am, Umme Essa <[email protected]> wrote: > Thanks Mike for your quick reply, I have tested with new API version > (2.184) but the error is still there. I cannot post the url of the > page as client don't want this. What I have done on the button is > pasted below. > > CustomControl saveHomeControl = new CustomControl(new ControlPosition( > ControlAnchor.BOTTOM_LEFT, 2, 2)) { > > @Override > public boolean isSelectable() { > return true; > } > > @Override > protected Widget initialize(final MapWidget map) { > saveHomeButton = new Button("Save center of > map as my home"); > > saveHomeButton.addListener(buttonListenerAdapter); > return saveHomeButton; > } > }; > > buttonListenerAdapter = new ButtonListenerAdapter() { > > @Override > public void onClick(Button button, EventObject e) { > LatLng latlang = map.getCenter(); > saveUserHome(latlang.getLatitude(), > latlang.getLongitude()); > } > > }; > > private void saveUserHome(double latitude, double langitude) { > > ApplicationContext applicationContext = ApplicationContext > .getApplicationContext(); > User currentUser = applicationContext.getCurrentUser(); > if (currentUser != null) { > UserServiceAsync userService = > GWT.create(UserService.class); > currentUser.setHomeLatitude(latitude); > currentUser.setHomeLongitude(langitude); > map.removeOverlay(homeMarker); > homeMarker = addMarker(0, > currentUser.getHomeLatitude(), > currentUser.getHomeLongitude(), "My > home", false); > userService.updateUser(currentUser, new > AsyncCallback<User>() { > @Override > public void onFailure(Throwable caught) { > > } > > @Override > public void onSuccess(User result) { > > } > }); > } > } -- You received this message because you are subscribed to the Google Groups "Google Maps API" 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-maps-api?hl=en.
