I’ve noticed a possible bug.
It happens only on IE.
If I add many markers to a map when initing the view IE seems to just give up drawing markers on map.
With many I mean anything between 7 and 1000, it usually works on smaller amounts, but 1000 takes very long to show up, or then nothing happens. All other browser manage to show the markers.
So I was wondering if calling this method in GoogleMap for 1000 times in a loop
causes 1000 requestrepaints and chokes IE?
public void addMarker(Marker marker) {
if (markerSource == null) {
markerSource = new BasicMarkerSource();
}
markerSource.addMarker(marker);
requestRepaint();
}
And if I could work around it with (haven’t tried it yet):
(Disclaimer: I don’t know about the Google map addon specifically)
That is server-side code, right? Calls to requestRepaint() do not actually cause anything to happen in the browser directly, it just marks the component as “dirty” so that the updates get sent to the client with the next response. I.e you can call requestRepaint() as often as you like; it’s quite inexpensive, and calling it multiple time vs once will have the same effect in the browser.
requestRepaint() just marks the component as “dirty” which will cause it to be rendered at the end of the request. This means that calling repeatedly within a request has no effect over calling it once.
The problem is probably that the browser chokes on the amount of marker draw commands.
One way to circumvent it is not to use BasicMarkerSource, and implement a lazy MarkerSource that will only send visible markers to the client.
Just a guess, but the problem might be the “client” part of the package name, which has a special meaning for GWT - at least under a directory containing a GWT module, unless you say otherwise in the GWT module.
Due to this, it might also be treated specially by the Eclipse plugin in some cases (I cannot recall) - but maybe also in cases where it should not be.
Hi Mr Henri ,
I’m a new beginner on the Vaadin framework, actually I’m processing into the Googlemap addon.
I’m using the netbeans version 6.8 , after inserting the package (2 jars) and recompiling them into my project I wrote this short code , figuring below,to test the addon.
/*
* MyApplication.java
*
* Created on May 28, 2010, 7:44 AM
*/
package com.example.vaadin;
import com.vaadin.Application;
import com.vaadin.ui.*;
import java.awt.geom.Point2D;
import org.vaadin.hezamu.googlemapwidget.GoogleMap;
import org.vaadin.hezamu.googlemapwidget.overlay.BasicMarker;
public class MyApplication extends Application {
@Override
public void init() {
Window mainWindow = new Window("MyApplication");
// Create a new map instance centered on the IT Mill offices
GoogleMap googleMap = new GoogleMap(this, new Point2D.Double(22.3, 60.4522), 8);
googleMap.setWidth("640px");
googleMap.setHeight("480px");
// Create a marker at the IT Mill offices
googleMap.addMarker(new BasicMarker(1L, new Point2D.Double(22.3,
60.4522), "Test marker"));
mainWindow.addComponent(a);
mainWindow.addComponent(googleMap );
setMainWindow(mainWindow);
}
}
Unfortunately the system display an internal error, could you help me to under pass this pb.
thx for your help and your time best regards.
and nothing happens. I mean, all the interesting stuff is actually buried in your server’s logs. Maybe better to post its traceback contents here in the meanwhile, please?
Hi! , i’m new on vaadin … just a few days and now i’m in love !.
Everything is working ok , but i found that when i add marker to the map only the first one is actually drawed , i try a couple of things like using “addmarker” ,“markersource” , “basicmarkersource” , using the refresher add-on , but only the first marker is drawed , once the marker is on the map i can delete it , but it’s not drawed again when i try to do it.The refresher add-on works fine , as i can do zoom o position changes on time intervals , etc.
The problem is the same with polyoverlay , any help on this ?.Thanks.
Hi , i’ve been out of the city a few days so i can’t read the forum , i fixed the problem , it seems tha tomcat was the problem because i update to tomcat 6.0.26 and everything works fine , but something new is going wrong .
When i delete a marker or a bunch of them i can’t add new marker with the same ID that i delete , for example create a marker with the ID 1L then i delete it and again create a marker with that ID and it’s not drawed , is this normal ? or maybe tomcat again ?, and the other thing is the the setvisible() method for a marker it’s not working , it’s not a big problem just want it to create a blinking mark , but i replace it with an animated icon for the marker.
We have been trying out Vaadin and your Google Map widget in particular for an educational game project, where interaction with a map is our primary functionality. We really like Vaadin, particularly in terms of how rapidly we can develop and prototype, but as the Map is very central to game play, we have a few questions.
I realize that you have stated there isn’t a schedule for feature releases, but I wanted to be sure I wasn’t missing features that are already there or misunderstanding…
There are some features from Google Maps that don’t appear to be implemented at this point - correct me if I am wrong:
Display satellite images instead of map layers
Turning off labels (if above)
The zoom and pan controls that are typically on the left side of a google map
Other questions:
Is it possible to set the default zoom level when a map is rendered?
Is it possible to change a marker icon when it is clicked? I have the marker rendering with the icon, and the click event working for the marker, but changing the icon as part of that event doesn’t seem to redraw.
Thanks in advance. We are very much hoping to be able to use your component, and by extension this framework, for this project and lots more to come!