Google Maps and imagemap widgets updated

Hi,

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?

Thanks a lot!

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 :slight_smile:

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.

Hi, i created something to use with imageMap but it’s not working with IE, when i try with firefox is ok.

It’s something that i’m doing or it’s a limitation?

That was a regression, sorry. The first post contains a fixed JAR.

Henri, i got this new jar but still didn’t work, with your demo app is working now, but it’s now working with mine. Is there something missing?

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.

What could it be?

back home i did a new test and it’s working, idk what i did wrong before, anyway, thanks for you help.

Very nice your component!! Congratulations!!

Hi,
Thank you very much. I’m using your component.

One question?

Is possible do a map with the route between two points, marking the route through a line or polygon?

Like getDirection () function in GWT.

Thank you in advance!!

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 anxiously await you update the component.


Thank you! For your contribution anyway.

Sorry again!!-_-

Two questions:

First : Is possible to add listener (clickListener) on Maker or something to know what maker the user has clicked??

Second : How to change the Google Key.

Thanks a lot!!

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?

Thank you!

I edited the widgetset xml-file and put Google Maps url (with correct key) to the script parameter. Works fine.

//Harri

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.

Did you add the gwt-maps.jar from the zip to your WEB-INF/lib?

Hi, sorry to ask, how could I put correct key into widgetset ?
Can you provide more information?

I’ve downloaded this from vaadin add on-site and got the map working fine, and can add markers to map.

Problem is that I can’t get the infomessage to show itself.
I’ve made a MapComponent that extends HorizontalLayout and has a private GoogleMap variable.

I’m out of ideas on what to do? Is this a bug or don’t I just have the right component se for the message, what should it be, null, the MapComponent I’ve made, the window behind it… ??

This shows my multiple efforts on how I’ve tried to get the message visible in the initData() function of MapComponent:

            addComponent(googleMap);
            BasicMarker m = new BasicMarker(1L, new Point2D.Double(22.3, 60.4522),
		"Test marker");
	m.setInfoWindowContent(null, new Label("a"));
	m.setDraggable(false);

	BasicMarker m2 = new BasicMarker(2L, new Point2D.Double(22.3, 60.5522),
		"Test marker2");
	m2.setInfoWindowContent(this, new Label("s"));
	m2.setDraggable(false);

	BasicMarker m3 = new BasicMarker(3L, new Point2D.Double(22.3, 60.6522),
		"Test marker3");
	m3.setInfoWindowContent(this.getWindow(), new Label("v"));
	m3.setDraggable(false);

            googleMap.addMarker(m);
	googleMap.addMarker(m2);
	googleMap.addMarker(m3);

but alas nothing happens when I click the marker.

Now is a time that I could say some rude words. :angry:

It happens to be so that the version I took from your download directory doesn’t work, but then I took the zip files from the first message, found some differences in code, tried it and it works. The popup shows up on all cases I wrote above.

I’m somewhat frustrated that the version in your official download-site isn’t working and I lost about a day of worktime on wondering what’s wrong.