Google Maps for Vaadin 7

Hey Tapio, thanks for the reply. I am using Ivy with this project. I tried adding GWT Maps API to the build path anyway, and it resulted in the same errors. Any other suggestions?

If you’re managing the GoogleMaps Add-on from Ivy there’s absolutely no need to add the API jar(s) to the classpath manually. With the current information it’s quite hard to say what causes the exception. It would be great if you could attach a minimalistic example project that faces the same issue.

If creating a project is not possible, could you at least attach your widgetset definition file (
com.project.paint_the_town.widgetset.Paint_the_townWidgetset.gwt.xml
) and your
ivy.xml
so that I could take a look if something goes wrong in either.

How can I use containsLocation? Like in this example: https://developers.google.com/maps/documentation/javascript/examples/poly-containsLocation

Thanks for the plugin for the googlemap.

I’ve using the plugin for my project and I would like to handle the zoom level in order to change the marker icon depending on the zoom level.

Would you help me out ? How to handle the zoom level event ?

thank you in advance !

How can I draw a circle on google maps? I am using this plugin but was unable to find a drawCircle() method or sth similar

Hi,
you need to implement MapMoveListener interface that contains ‘mapMoved’ method

@Override
public void mapMoved(int zoomLevel, LatLon center, LatLon boundsNE, LatLon boundsSW) {
        
        if(zoomLevel > threshold){
            
            //do something...
            
        }
 }

I’ve been looking at the api and you may do the following:
Create a GoogleMapControl and add it to the map using addControl. Attach a listener to your map: when clicking + icon increment the zoom, do stuff and call to setZoom. The same thing if the user clicks -.

Wouldn’t it be possible?

You must create a polygon using addPolygonOverlay

I’ve got a huge question relating maps addon for Vaadin. I’m not able of removing (or hiding) markers nor polylines. Removing polylines result impossible to me. Markers are removed little by little, click by click (considering a button which removes ALL the markers).

To remove a polygon, I’ve used

To remove markers, I’ve used both clearMarkers() (single line) and the following code:

for(GoogleMapMarker m : map.getMarkers()){
    map.removeMarker(m);
}

Here there is more information related tomy problem: https://vaadin.com/forum#!/thread/9424662/9483804

Any way to solve that?

Thanks!

It works well!

Thank you.

Well, i am aware that i can use polygons but that must be terrible to calculate tens of coordinates in order to build a circle. I was thinking of sth simple as it is on the mobile versions of the APIs.

Hi
I have a feature that consist of adding/removing multiple markers from the map once and it works fine with vaadin 7.3.10.

After upgrading to vaadin 7.4.2 this feature does not work anymore. When trying to remove the set of markers using the method clearMarkers(), only 1 markers is removed.

Any hints on the origin of this problems ??

Thanks for helps

Same problem here.

I switched to 7.3.10 and compiled the Widgetset → Removing more than one marker at a time works.
Switched back to 7.4.3 while keeping the old Widgetset → still works.
Compiling a 7.4.3 Widgetset → Bugged…

After clearMarkers() they are removed on the server but only the first marker on the client is removed.
Calling clearMarkers() again does nothing (even if it happens in another buttonclick).
Clicking on those bugged markers result in clickedMarker == null inside the MarkerClickListener.

I decided to move to leaflet

It seems to be some kind of bug in new Vaadin version that broke clearMarkers method. Anyway, I’ve created a fixed version. Google Maps add-on version 1.0.2 is already out. Please test it and report if you notice any new problems.

The test application I used can be found from
http://tapio.app.fi/googlemaps-clearmarkers-test/
. I’ve also attached the sources of the project in case you want to test it yourself.
19023.zip (889 KB)

Since there have been some requests that there should be an example Eclipse project having all the required dependencies, I’ve added the project mentioned in earlier post - googlemaps-clearmarkers-test - to GitHub.

You can use it as a starting point if you’re having problems when trying to use the add-on.


Checkout the project at GitHub
.

I’ll try it out :). Thanks!

Hi Tapio,

As far as I can tell, there is no way to add the URL signature when using the client ID (which is required by Google). See:
https://developers.google.com/maps/documentation/business/webservices/auth

Can you add this feature?

Thanks

Uhh…have they added another requirement for Maps API for Work? At least I haven’t been aware of URL signatures and no-one has requested them before. Quite annoying indeed. Please make a ticket about the issue so that I will more likely remember to add this feature to the next version.

Hi Tapio:

On the previous version Polylines didn’t work: no polylines were drawn nor removed. Has this been solved?

Thank you for your hard work!