This is probably one of my silly questions again, but i want to understand your map widget and vaadin in general because we will be using it for a potentially fairly large project. Everyone one of my Java colleagues that i have introduced Vaadin to has fallen in love with the framework almost straight away, but it is the map widget that we are all still grappling with.
Now my question is; could i use your google map widget as it is to build an application that does things like route display(with colouring), street view, geocoding and reverse geocoding, etc.? It probably is possible with a lot of work, but i was just wondering if i could use your map widget in it’s curent incarnation and get all of that functionality.
I have just checked out your new version GoogleMapWidget. And I add some new lines based on the demo GoogleMapWidgetApp.java you wrote.
public void init() {
setMainWindow(new Window("GoogleMapWidgetApp"));
// 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
BasicMarker m = new BasicMarker(1L, new Point2D.Double(22.3,60.4522), "Test marker");
m.setInfoWindowContent(null, new Label("a"));
googleMap.addMarker(m);
getMainWindow().addComponent(googleMap);
}
But when I click the marker, the infowindow doesn’t come out.
I don’t know why, because the some code runs well in the pervious version.
And I’m not very sure about the parent component, so I always use null.
Could you give a dome about how to set the infowindow?
Yes, I’m afraid the current implementation does not support the geocoding or street view stuff that’s in the maps API, but it should be pretty straightforward to implement.
This link contains the relevant info, but it will require GWT coding.
The component is just a 10% project for me, and I don’t know when I’ll get around adding such functionality, but of course the code is open source so anyone is welcome to take a stab at it
That was a regression introduced at the last update, sorry. I fixed it and updated the package in the first post, your code should work with it.
Did you re-compile your application widgetset after copying the new jar to WEB-INF/lib? Also note that the filename changed a bit, so you need to remove the old one before recompilation.
I remove old file first, eclipse ask to recompile, then i put the new file, eclipse ask to recompile again.
I even tried to select xml file and ctrl + 6. Nothing is showed on console, it does something.
I’m afraid that the component only supports a limited subset of the Google Maps API, and routing is one of the many things not supported at the moment.
I tried to compile the widgetset, but I got the following error:
[ERROR]
Unable to find ‘com/google/gwt/maps/GoogleMaps.gwt.xml’ on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?
[ERROR]
Line 6: Unexpected exception while processing element ‘inherits’
Am I missing something here? Should I add something more than just the jar-file?
Not at the moment, but this would be trivial so I’ll add it in the next release.
Harri already described how to do this, but I’m currently looking into a API for changing the key, so that you wouldn’t need to recompile the widgetset.
I’ll try to release a new version soon with both of these improvements.