[OpenLayers-Users] pseudo-markers using images?

Alessandro Ferrucci alessandroferrucci at gmail.com
Wed Jul 6 07:45:08 EDT 2011


Hello,
I'm recently contemplating the extent with which google maps can draw
"markers" on their maps

if you go to maps.google.com, select "wikipedia" from their layer switcher
it draws an immense number of markers on the screen (I've included a
snapshot of this in this email)

So I wanted to dig deeper in to how they were doing this.  I introspected
the requests using firebug and saw that these "markers" are nothing more
than WMS requests, so all I am seeing are pre-rendered markers, ok fine
enough.

but then... I hover over one of the markers... lo and behold the mouse
changes! right away, *without* another request going back to their server !
so there is more to their implementation of markers than just simply
returning images...

I know they are images because I introspected the requests coming back, they
are 256X256 PNG's,  one such request is this one

http://mt1.google.com/mapslt?lyrs=org.wikipedia.en&x=3&y=2&z=4&w=256&h=256&gl=us&hl=en

it seems like they return enough information such that as you hover your
mouse over the "marker layer" they know when to change the mouse over to the
pointy finger cursor.. but how do they do that?  Do they return some
JSON-like information
that is essentially a map of small rectangles along with some auxiliary
information?  then as you hover your mouse they calculate on the fly if the
mouse is *within* any given rectangle and if it is extract the auxiliary
information that came
with that rectangle and display it?

The data they are returning has to be more than just a dot, it has to be a
rectangle because the "W" boxes are of varying sizes and simply hovering
over to the edge of any given box the mouse changes and the information that
came with that box comes up.

Anyone ever pondered and/or prototyped such a solution in OpenLayers as they
are providing?  If you were to take up such a challenge would you implement
it as I've described it? Is there a much faster/better solution?

-- 
Signed,
Alessandro Ferrucci
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110706/f8834a07/attachment.html


More information about the Users mailing list