[Talk-in] How to Server Any default Image in Empty Tiles
PARVEEN ARORA
parveenaroraosm at gmail.com
Tue Jun 29 20:09:16 BST 2010
Hello everyone,
I have set up a OSM tile server which is at:
http://202.164.53.116/~parveen
i have rendered some area upto zoom level 19,
and other area is less than 19 zoom level,
so that area is showing no images found.
I want to put there a default image, of data is not available or any other
like it.
Is there any need to change the code to do it.
The code i used is given below:
<html> <head> <title>OpenLayers Demo</title> <style type="text/css">
html, body, #basicMap {width: 100%; height:
100%; margin: 0; } </style> <script src="
http://202.164.53.116/~hsrai/OSM/OpenLayers.js"></script> <script> function
init() { map = new OpenLayers.Map("basicMap");// var mapnik = new
OpenLayers.Layer.OSM(); // map.addLayer(mapnik); var newLayer = new
OpenLayers.Layer.OSM("New Layer", "
http://202.164.53.116/~hsrai/OSM/tiles/${z}/${x}/${y}.png", {numZoomLevels:
20}); map.addLayer(newLayer); map.setCenter(new
OpenLayers.LonLat(75.8588,30.904) // Center of the map .transform( new
OpenLayers.Projection("EPSG:4326"), // transform from WGS 1984 new
OpenLayers.Projection("EPSG:900913") // to Spherical Mercator Projection ),
10 // Zoom level ); } </script> <script type="text/javascript"> function
openMapKey() { updateMapKey(); openSidebar({ title: "Map key", onclose:
closeMapKey }); map.events.register("zoomend", map, updateMapKey);
map.events.register("changelayer",
map, updateMapKey); } function closeMapKey()
{map.events.unregister("zoomend", map,
updateMapKey);map.events.unregister("changelayer", map, updateMapKey);
} function updateMapKey() { var layer = map.baseLayer.keyid; var zoom =
map.getZoom(); new Ajax.Updater('sidebar_content', '/key',
{asynchronous:true, evalScripts:true, method:'get', parameters:'layer=' +
layer + '&zoom=' + zoom}) }</script> <script type="text/javascript">
<!--function startSearch() { updateSidebar("Search
Results", ""); } function describeLocation() { var args =
getArgs($("viewanchor").href); new Ajax.Request('/geocoder/description',
{asynchronous:true, evalScripts:true,
onLoading:function(request){startSearch()}, parameters:'lat=' + args['lat']
+ '&lon=' + args['lon'] + '&zoom=' + args['zoom']}) } function
setSearchViewbox() { var extent = getMapExtent(); $("minlon").value =
extent.left; $("minlat").value = extent.bottom; $("maxlon").value =
extent.right; $("maxlat").value = extent.top; } // --></script>
</head> <body
onload="init();"> <div id="basicMap"></div> </body> </html>
--
With Kind Regards
Parveen Arora
www.osmpunjab.co.cc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/talk-in/attachments/20100630/e4e510c2/attachment.html>
More information about the Talk-in
mailing list