[OpenLayers-Users] Mouse events on tiles

tim robertson timrobertson100 at gmail.com
Wed Jul 1 08:31:13 EDT 2009


Hi Kevin,

I am afraid to say I gave up on openlayers as my JS development skills
were not good enough to get it working... I could not work out how to
attach mouse event handlers on the tiles.  I got it working with
Google Maps JS API and with Google Maps Flex API pretty easily and
still have ambitions to get openlayers working at some point.

I was not using wikipedia data layers, but producing my own tiles for
our own data (e.g. http://tools.gbif.org/geoBalance/data/4_4_9.png)
and sending data (http://tools.gbif.org/geoBalance/data/4_4_9.txt) for
the file as well.  Turned out I had 1.4 Billion tiles which I produce
using Hadoop and am currently researching Voldemort to serve them.  I
got PNG rendering down to about 30msecs per tile (in Java by using a
custom PNG encoder as the SDK one is very slow), so render the PNG in
real time from the raw txt file.

Watching the network traffic from the browser, you can see google
requesting the wikipedia tiles:
http://mlt0.google.com/mapslt?lyrs=org.wikipedia.en&x=3&y=5&z=4&w=256&h=256
I am *pretty sure* you are not allowed to call them directly though!

Cheers

Tim




On Wed, Jul 1, 2009 at 1:10 PM, Kevin Kempfer<mail at kevinkempfer.de> wrote:
> Hi Tim,
>
> did you have any success on this? I am too planing to overlay wikipedia data
> in openlayers (as well es panoramio). Would be nice to hear you had success.
> Which webservice are you using to retrieve the wikipedia data?
>
> Thanks,
>
> Kevin
>
> tim robertson schrieb:
>>
>> Hi all,
>>
>> I am trying to reproduce with openlayers, the same effect that
>> maps.google.com has with overlaying wikipedia articles.  I have a TMS
>> layer, rendering the tiles server side and also have a web service
>> providing the info about the pixels on the tile the features are (just
>> like how google wikipedia overlay works).  I am not that great a
>> Javascript and have been trying to work out where to attach mouseover
>> and onclick events to the Image Tiles but have not succeeded.  I will
>> need to detect mouseover and mouseout to make sure that I am not
>> checking against the features for the whole map as the cursor moves
>> over tiles as this would be much data to check.  While a cursor is on
>> a tile I was planning to check the data array and see if the cursor
>> was over a feature.
>>
>> Can someone please advise me where best to attach mouse events to
>> individual tiles?  I have been playing with various options, all of
>> which got messy quickly - currently I am trying to subclass
>> OpenLayers.Layer.TMS and modifying addTileMonitoringHooks.  Is this
>> the correct way to proceed?  Any advice is greatly appreciated.
>>
>> Many thanks,
>>
>> Tim
>> _______________________________________________
>> Users mailing list
>> Users at openlayers.org
>> http://openlayers.org/mailman/listinfo/users
>>
>
>
> --
> http://www.kevinkempfer.de
> Tel.: (07071) 860303
> ICQ:  2186573
> Skype: kevin0815
>
> Schön, wenn man die Frau für´s Leben gefunden hat.
> Schöner, wenn man ein paar mehr kennt.
>
>



More information about the Users mailing list