[OpenLayers-Users] Capture Tile information

Tobias Reinicke ramotswa at gmail.com
Thu Feb 16 08:48:39 EST 2012


So if you had an OSM layer.

Register an event on tileloaded on it
 OSMM.events.register("tileloaded", function (e) {
                var myVar= e;
}

and then somewhere in "myVar" you need to check if "olImageLoadError"
is present. One area could be myVar.element.childNodes[0].innerHTML

for me that is:
"<img id="OpenLayersDiv77" style="position: relative; width: 256px;
height: 256px; " class="olTileImage olImageLoadError" src=....>"

You can do a text comparison to find if olImageLoadError is in there
and report something back accordingly.

I have not ever implemented this nor do I think it is a particularly
good solution, but it should do what you are after.

Toby



On 16 February 2012 13:08, francescoboccacci at libero.it
<francescoboccacci at libero.it> wrote:
> Hi, can you tell me how look at the css class? can you explain it more clear?
> Can you write a simple example ?
> Thanks in advance...
>
> Francesco
>
>>----Messaggio originale----
>>Da: ramotswa at gmail.com
>>Data: 16/02/2012 14.02
>>A: "francescoboccacci at libero.it"<francescoboccacci at libero.it>
>>Cc: <bamerbalazs at gmail.com>, <openlayers-users at lists.osgeo.org>
>>Ogg: Re: Re: [OpenLayers-Users] Capture Tile information
>>
>>No I understand what you are trying to do, but you can,
>>programatically, look at the css class of every tile that comes in
>>apparently.
>>
>>On 16 February 2012 12:53, francescoboccacci at libero.it
>><francescoboccacci at libero.it> wrote:
>>> ye..with firebug i can see all requests .. but i'd like to capture the
> response
>>> from the server if i'm using the tile from my cache or from server(fresh
> tile).
>>> I don't know if is possible but it will be very interesting.Maybe we have
> to
>>> work into openlayers code. Thanks
>>>
>>> Francesco
>>>
>>>>----Messaggio originale----
>>>>Da: bamerbalazs at gmail.com
>>>>Data: 16/02/2012 13.38
>>>>A: <openlayers-users at lists.osgeo.org>
>>>>Ogg: Re: [OpenLayers-Users] Capture Tile information
>>>>
>>>>Hi Imran,
>>>>
>>>>> You can see your http request using FireBug, if you are using FireFox.
>>>>
>>>>Yes, but I thought a check during runtime from JavaScript. So that
>>>>instead of displaying pink tiles, I would write a message about the
>>>>problem with X layer.
>>>>
>>>>best regards: Balázs
>>>>_______________________________________________
>>>>Users mailing list
>>>>Users at lists.osgeo.org
>>>>http://lists.osgeo.org/mailman/listinfo/openlayers-users
>>>>
>>>
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>>
>
>


More information about the Users mailing list