How to retrive the tile URL in openlayers3?

المشرف العام

Administrator
طاقم الإدارة
I have a question about Openlayers3 , I have the below code that initializes my map on my small demo application:

var map = new ol.Map({ layers: [ new ol.layer.Tile({ source: new ol.source.OSM() }) ], target: 'map', controls: ol.control.defaults({ attributionOptions: /** @type {olx.control.AttributionOptions} */ ({ collapsible: false }) }), view: view}); You can see a demo HERE

Now my question is how do I get the Tile url , so that I can store it locally using localstorage ? how do I get the Tile url ?

I saw the ol.TileUrlFunctionType() , but i am not sure how to use it ? can anybody help me understand how to get the tile url ? (can can play around in the chrome dev tools for the demo that i have provided.)



أكثر...
 
أعلى