How to get offline tiles first else pull online tiles in Openlayers 3 using source.XY

المشرف العام

Administrator
طاقم الإدارة
I have a cordova phone app where some of the tiles are stored in the filesystem. If they are not in the filesystem, I want to get them from my webserver.

source: new ol.source.XYZ({ urls:[my_OBJ.nativeURL+'2_{z}_{x}_{y}.png','http://my-server.com/tiles.php?Z={z}&X={x}&Y={y}&T=2'] })The above works fine for offline tiles in the filesystem. Tiles from my-server do not fill the map. For some reason they are alternating rows. If I flip the urls array the missing rows alternate exactly opposite. I'm guessing I need to use a solution such as https://groups.google.com/forum/#!topic/ol3-dev/gd2OXsrKBTk but I can't figure it out.



أكثر...
 
أعلى