On Thu, Feb 16, 2012 at 4:28 PM, [email protected] <[email protected]> wrote: > sorry Andreas, my misunderstanding. I would like to try to manage some > information about traffic request from the server.
You should do that on the server really. Andreas. > That's all. Thanks for your suggestions. > Francesco > >>----Messaggio originale---- >>Da: [email protected] >>Data: 16/02/2012 16.20 >>A: "[email protected]"<[email protected]> >>Cc: <[email protected]> >>Ogg: Re: Re: Re: Re: Re: [OpenLayers-Users] Capture Tile information >> >>You cannot. All I was saying was that the tileloaded event is also >>fired for tiles that come from the cache. Why would you want to know >>which tiles come from the browser cache? >> >>Andreas. >> >>On Thu, Feb 16, 2012 at 4:15 PM, [email protected] >><[email protected]> wrote: >>> Hi Adreas, how is possible capture this information? >>> >>> I use this code: >>> >>> >>> layer.events.register("tileloaded", layer, function() { >>> if (document.getElementsByClassName("olImageLoadError"). >>> length) { >>> error+=1; >>> } >>> }); >>> By this way i count the number of tiles that aren't loaded. How can > capture >>> the tiles coming from the cache? >>> >>> Thanks in advance >>> >>> Francesco >>> >>> >>>>----Messaggio originale---- >>>>Da: [email protected] >>>>Data: 16/02/2012 16.08 >>>>A: "[email protected]"<[email protected]> >>>>Cc: <[email protected]>, <[email protected]> >>>>Ogg: Re: Re: Re: Re: [OpenLayers-Users] Capture Tile information >>>> >>>>No, this is not possible. But the tileloaded event will also fire when >>>>the image comes from the cache. >>>> >>>>Andreas. >>>> >>>>On Thu, Feb 16, 2012 at 2:56 PM, [email protected] >>>><[email protected]> wrote: >>>>> Good solution.. the last question is: >>>>> i can capture if an error is occurs during the tile loading >>> (olImageLoadError) >>>>> , but is possible to check if the tile is already present in my cache > (304 >>>>> response from server)? >>>>> Thanks again .. >>>>> >>>>> Francesco >>>>> >>>>>>----Messaggio originale---- >>>>>>Da: [email protected] >>>>>>Data: 16/02/2012 14.48 >>>>>>A: "[email protected]"<[email protected]> >>>>>>Cc: <[email protected]>, <[email protected]> >>>>>>Ogg: Re: Re: Re: [OpenLayers-Users] Capture Tile information >>>>>> >>>>>>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, [email protected] >>>>>><[email protected]> 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: [email protected] >>>>>>>>Data: 16/02/2012 14.02 >>>>>>>>A: "[email protected]"<[email protected]> >>>>>>>>Cc: <[email protected]>, <[email protected]> >>>>>>>>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, [email protected] >>>>>>>><[email protected]> 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: [email protected] >>>>>>>>>>Data: 16/02/2012 13.38 >>>>>>>>>>A: <[email protected]> >>>>>>>>>>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 >>>>>>>>>>[email protected] >>>>>>>>>>http://lists.osgeo.org/mailman/listinfo/openlayers-users >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> Users mailing list >>>>>>>>> [email protected] >>>>>>>>> http://lists.osgeo.org/mailman/listinfo/openlayers-users >>>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> Users mailing list >>>>> [email protected] >>>>> http://lists.osgeo.org/mailman/listinfo/openlayers-users >>>> >>>> >>>> >>>>-- >>>>Andreas Hocevar >>>>OpenGeo - http://opengeo.org/ >>>>Expert service straight from the developers. >>>> >>> >>> >>> _______________________________________________ >>> Users mailing list >>> [email protected] >>> http://lists.osgeo.org/mailman/listinfo/openlayers-users >> >> >> >>-- >>Andreas Hocevar >>OpenGeo - http://opengeo.org/ >>Expert service straight from the developers. >> > > -- Andreas Hocevar OpenGeo - http://opengeo.org/ Expert service straight from the developers. _______________________________________________ Users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/openlayers-users
