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