public RefreshPointPage()
{
map = new GMap2("map", GMapExampleApplication.get().getGoogleMapsAPIkey());
add(map);
GOverlay overlay = createOverlay("Amsterdam", new GLatLng(52.37649, 4.888573), "image.gif",
"shadow.png");
map.addOverlay(overlay);
map.add(new GMapAutoUpdatingBehavior(Duration.seconds(5))
{
private static final long serialVersionUID = 1L;
private int i = 1;
@Override
protected void onTimer(AjaxRequestTarget target, GMap2 map)
{
GOverlay overlay;
if (i % 3 == 0)
{
overlay = createOverlay("Amsterdam", new GLatLng(52.37649, 4.888573),
"image.gif", "shadow.png");
i = 0;
}
else if (i % 3 == 1)
{
overlay = createOverlay("Amsterdam", new GLatLng(52.37649, 4.888573),
"image2.gif", "shadow2.png");
}
else
{
overlay = createOverlay("Toulouse", new GLatLng(43.604363, 1.442951),
"image2.gif", "shadow2.png");
}
i++;
map.setOverlays(Collections.singletonList(overlay));
}