Hi

I have a problem in using gmap2 wicket api, when it refreshes the marker and
at the same time if user has opened the infowindow, it immediately shuts it
off (i.e. while setting overlays), which is distracting for the user
experience.

below is the code for more insight:

map.add(new ClickListener() {

  @Override
  protected void onClick(AjaxRequestTarget target, GLatLng latLng,
  GOverlay overlay) {
   try {
    if (overlay.getId() != null) {
     GMarker m = (GMarker) overlay;
     SiteGlueInfo siteInfo = webApp.getListSitesHelper().getSiteInfoById(
     m.getMarkerOptions().getTitle());
     IModel model = new Model();
     model.setObject(siteInfo);
     map.getInfoWindow().open(
     m.getLatLng(),
     new SiteInfoPanel(siteInfo.getSiteId(), model));
   }
  } catch (Exception e) {

  }

  }
  });

map.add(new GMapAutoUpdatingBehavior(Duration.seconds(15)) {

  private static final long serialVersionUID = 1L;

  @Override
  protected void onTimer(AjaxRequestTarget target, GMap2 map) {
  map.setOverlays(createOverlay(map));
  }
  });

Thanks for any help in advance.

Best regards,

Shiraz

Reply via email to