-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I have created a ZK application that uses the Zk Google Maps library. In this application I would like a button that, once clicked, should prompt the map to be displayed with the specific marker in the center. I have created a method that handles the event of the click of the 'centerMarkerButton' button:
public void onClick$centerMarkerButton(event evt){
myMap.setCenter(marker.getLat(), marker.getLng());
}
However when clicked, the map doesn't do anything. The following method, which put the marker in the center of the map whenever the map is moved, contains the same code and fully works:
public void onMapMoved$myMap(event evt){
myMap.setCenter(marker.getLat(), marker.getLng());
}
Can someone explain me why the first method doesn't work and what a possible solution to this problem can be? THANKS IN ADVANCE
Asked: 2014-05-06 21:03:05 +0800
Seen: 6 times
Last updated: May 06 '14
duplicate of http://forum.zkoss.org/question/92563/problem-using-setcenter-method-with-zk-google-maps/
chillworld ( 2014-05-06 21:45:41 +0800 )edit