Google Fusion refresh layer when add a KML layer

92 views
Skip to first unread message

Bob

unread,
Jun 1, 2011, 9:54:12 AM6/1/11
to google-map...@googlegroups.com

Hello,


I already asked this question on the Google Fusion group. They could reproduce the problem but told me that I should ask it here.


I am currently using a Google Fusion table inside my Google Maps. I made a custom click function which add's a polygon with a KML layer of the selected Polygon on top of the Google Fusion table to give a 'clicked on this polygon' effect, and you can also select multiple poloygon's by holding the shift button.


But whenever I add a KML polygon, the whole Google Fusion layer refreshes (so disappaears and appears again) which is kind of ugly and not really usable.


Am i doing something wrong, and is there a way to not let the Google Fusion Layer (and also the KML layer) refresh on adding/changing a layer?


Technical steps:

I have a Google Fusion layer (that's what you see when you start the website). When you then click on a Polygon, the infowindow is suppressed and catched by the website, this has the ID in it, with that ID i look up the Polygon information of that same Polygon in my own MySQL database and add a KML layer on top of the Google Fusion layer. This is for the feedback that you have clicked a layer (you can use shift to select multiple layers).


The relevant code can be found in:

http://klanten.visualweb.nl/googlemaps-test/js/layers/kadaster.js 

line 48: showing of the Google Fusion layer

line 61: listener for the clicking event on a Google Fusion Layer

line 75: adding the KML layer 


The website can be found at:

http://klanten.visualweb.nl/googlemaps-test/


Best regards,

Bob Violier

VisualWeb

Bob

unread,
Jul 19, 2011, 5:21:39 AM7/19/11
to google-map...@googlegroups.com
I still have this problem, does anyone have an idea what I can do about it?

James McGill

unread,
Jul 19, 2011, 5:44:13 AM7/19/11
to google-map...@googlegroups.com
Hi Bob,

What you see is what is expected. Fusion Tables and KML layers are both produced by rendering image tiles server side so that large amounts of data can be shown.

I'd suggest having a server output the polygons as JSON (or similar) and using google.maps.Polygon to display them. This will avoid the refresh, and you can also do neat things like change the polygon color on mouse over.

Regards,
James

On Tue, Jul 19, 2011 at 7:21 PM, Bob <b...@visualweb.nl> wrote:
I still have this problem, does anyone have an idea what I can do about it?

--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-maps-js-api-v3/-/qvE9-Trkai8J.

To post to this group, send email to google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply all
Reply to author
Forward
0 new messages