[OSM-dev] Fwd: Fwd: Local Tiles on JSP + Tomcat issue

Reshma Maner r_maner at transworld-compressor.com
Wed Aug 22 08:48:24 BST 2012


I have set up osm2pgsql,mapnik on ubuntu server. I have also generated 
tiles locally.
Now I want to display these tiles on map in a JSP page. I am using open 
I have been trying it. The code works fine in html, but if same thing I 
do in a jsp page, it does not open map tiles. Only pink canvas is 
displayed. On rightclick, it displayes map tile path as 
"/LocalFolder///.png". source code is given below.
Please let me know what is the procedure I should follow to display 
local map on a jsp page(Tomcat server),

          var newLayer = new OpenLayers.Layer.OSM("Localhost",
"IndiaMap/${z}/${x}/${y}.png", {numZoomLevels: 4, alpha: true,
isBaseLayer: true});

  	            var switcherControl = new

             if( ! map.getCenter() ){
                 var lonLat = new OpenLayers.LonLat(lon,
lat).transform(new OpenLayers.Projection("EPSG:4326"),
                 map.setCenter (lonLat, zoom);

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20120822/2477145d/attachment-0001.html>

More information about the dev mailing list