[Google Maps API v3] Tracking map performance

448 views
Skip to first unread message

Anders Conbere

unread,
May 24, 2010, 8:45:50 PM5/24/10
to Google Maps JavaScript API v3
Like many people, one of my daily struggles is getting Maps to display
more markers while still being speedy, I already know of a lot of
possible routes you can take, from making your own overlays, to
injecting img tags into one overlay a la redfin. But my question is
more about how we can actually go about tracking map performance.

Since Markers appear to be added asynchronously, and marker add
performance is one of the key metrics I'm interested in, I'm stumped
as to how to measure it.

Is there an event that's called for every marker added? (preferably
after the dom is finished loading?)

Is there a function I can ... overwrite to get this data?

How are people tackling trying to speed up their maps in a data
centric method, as opposed to just hunting and pecking?

Thanks!

~ Anders

--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
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.

Ben Appleton (Google Employee)

unread,
Jun 2, 2010, 12:09:33 AM6/2/10
to Google Maps JavaScript API v3
Hi Anders,

At present there's no way to measure the time to render a marker in
v3. We're chatting about how to expose that for performance testing.

In case you hadn't considered it already: if you want to display
thousands of markers we recommend KmlLayer. This requires that your
server generate KML or geoRSS for your markers, but that's probably
straight-forward if you're already generating JSON for the browser to
display markers. KmlLayer can handle thousands of markers because it
renders the markers as an image tile layer, plus JSON hit maps for
click detection. Unlike v2's GGeoXml, v3's KmlLayer also exposes the
data for individual markers on "click" event.

Cheers
Ben

nianwei

unread,
Jun 2, 2010, 11:27:07 AM6/2/10
to Google Maps JavaScript API v3
Ben,
What does KmlLayer (via image tile layer) mean for Enterprise
customers, if the KML server is not visible to Internet outside
firewall? Also, the actual data must be pulled from the data source to
one of the Google rendering server, so the size of the data can be a
concern, (if more than just a few megabytes), right?
And is there a way to control the refresh/cache/timeout of the tile
layer on Google image server? I vaguely recall in V2 it was like 2 hrs
or so, it would be nice to able to control that for time sensitive
data.

Thanks.

--Nianwei

On Jun 2, 12:09 am, "Ben Appleton (Google Employee)"

Ben Appleton

unread,
Jun 2, 2010, 7:45:47 PM6/2/10
to google-map...@googlegroups.com
Hi Nianwei,

On Thu, Jun 3, 2010 at 1:27 AM, nianwei <nia...@gmail.com> wrote:
> Ben,
>  What does KmlLayer (via image tile layer) mean for Enterprise
> customers, if the KML server is not visible to Internet outside
> firewall?

Right - if Google cannot access your KML server, we cannot render your
KML as image tiles.

One possibility is to serve your KML from a publicly-accessible web
server but use securely signed URLs. Your webserver would serve the
signed KML URLs to your internal web pages (which are only accessible
inside your VPN) so that your web pages can display the KML. It would
only serve the KML content when Google requested it, if the URL
signature was valid. For increased security you can include the
current time in hours in your KML URL, so your webserver can reject
old URLs.

> Also, the actual data must be pulled from the data source to
> one of the Google rendering server, so the size of the data can be a
> concern, (if more than just a few megabytes), right?

Files can be up to 3MB zipped, 10MB unzipped:
http://code.google.com/apis/kml/documentation/mapsSupport.html

>  And is there a way to control the refresh/cache/timeout of the tile
> layer on Google image server? I vaguely recall in V2 it was like 2 hrs
> or so, it would be nice to able to control that for time sensitive
> data.

I'll have to check: I think we honor the HTTP Cache-Control header
that you put on your KML, but we may impose a minimum cache lifetime
to avoid making too many requests to your server. But if you have
time-sensitive data, you could include the time in your KML URL.

Cheers
Ben

anders conbere

unread,
Jun 3, 2010, 3:49:34 PM6/3/10
to google-map...@googlegroups.com
Ben,

Wow... yeah we weren't familiar with the KMLLayer I haven't dug into
this really at all other than the V2 polygon rendering. I'll
definitely report back on our experiences.

As for tracking marker performance, I know we would just love to see
some specialized events on each layer for onAdd, onRemove, etc. that
we could use to track total loading speed.

Thanks for getting back to me so promptly :)

~ Anders

Reply all
Reply to author
Forward
0 new messages