problem using setCenter() method in ZK GMaps [closed]

asked 2014-05-06 21:03:05 +0800

Antoc gravatar image Antoc
21 4

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

delete flag offensive retag edit

The question has been closed for the following reason "duplicate question" by chillworld
close date 2014-05-06 21:45:33


Question tools




Asked: 2014-05-06 21:03:05 +0800

Seen: 5 times

Last updated: May 06 '14

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More