Hi, I have created local tiles using Mapnik. Now I want to display the local tiles on a webpage(JSP Running on tomcat). I have tried html code and it works fine. But it does not work in JSP. Can anybody help me in this? asked 21 Aug '12, 11:47 Reshma Maner NicolasDumoulin |
The question has been closed for the following reason "Duplicate Question" by NicolasDumoulin 22 Aug '12, 12:34
Are you sure that your Java EE server is configured to serve static files from the directory containing your tiles? Can you access directly to a tile, by bypassing your jsp page? answered 21 Aug '12, 14:23 NicolasDumoulin Yes, I can access the tiles using html sample code given on link below. http://wiki.openstreetmap.org/wiki/OpenLayers_Local_Tiles_Example. Only if I add the same code in a jsp page, it does not display the images, but on mouse over, lat long is displayed.
(21 Aug '12, 14:31)
Reshma Maner
But do you access this html page with your java EE server? BTW, which server do you use? If you can access directly to tiles with your webserver, you should look at the html code served from your JSP in your browser.
(21 Aug '12, 14:35)
NicolasDumoulin
I am using tomcat server.
(21 Aug '12, 14:37)
Reshma Maner
|
Can you explain what doesn't work and provide some error messages or log entries if possible?
var newLayer = new OpenLayers.Layer.OSM("Local Tiles", "tiles/${z}/${x}/${y}.png", {numZoomLevels: 19, alpha: true, isBaseLayer: false}); map.addLayer(newLayer);
This code works fine in html file and the map tiles are opening. But the same code does not open any map image in jsp code. Only pink background is displayed. And if I move the mouse, it displayes lat long attributes also.
When I check by view source option of browser, it shows tile path as tiles///.png
I've closed this question as you have opened another one with more details.