I'm running my own Openstreetmap server with Mapnik installed.<br>
I tried a simple example but the tiles are not loaded.<br>
The online version works (without the Mapnik part and the url's)<br>
I can load a tile from my server e.g. http://xxx.xxx.xxx.xxx/osm_tiles/18/137213/91823.png<br><br>
Please provide me a working sample. (I'm stuck for days)<br><br>
My code;<br>
<pre><!DOCTYPE HTML>
<html>
<head>
<title>OpenLayers Simplest Example</title>
</head>
<body>
<div id="Map" style="height:600px"></div>
<script src="OpenLayers.js"></script>
<script>
var lat = 47.35387;
var lon = 8.43609;
var zoom = 18;
var fromProjection = new OpenLayers.Projection("EPSG:4326"); // Transform from WGS 1984
var toProjection = new OpenLayers.Projection("EPSG:900913"); // to Spherical Mercator Projection
var position = new OpenLayers.LonLat(lon, lat).transform( fromProjection, toProjection);
var url = ["http://xxx.xxx.xxx.xxx/osm_tiles/${z}/${x}/${y}.png",
"http://xxx.xxx.xxx.xxx/osm_tiles/${z}/${x}/${y}.png",
"http://xxx.xxx.xxx.xxx/osm_tiles/${z}/${x}/${y}.png"];
map = new OpenLayers.Map("Map");
var mapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik", url);
map.addLayer(mapnik);
var markers = new OpenLayers.Layer.Markers( "Markers" );
map.addLayer(markers);
markers.addMarker(new OpenLayers.Marker(position));
map.setCenter(position, zoom);
</script>
</body>
</html></pre>
<br/><hr align="left" width="300" />
View this message in context: <a href="http://osgeo-org.1560.n6.nabble.com/Openlayers-and-Mapnik-loading-problem-tp5013551.html">Openlayers and Mapnik loading problem</a><br/>
Sent from the <a href="http://osgeo-org.1560.n6.nabble.com/OpenLayers-Users-f3910695.html">OpenLayers Users mailing list archive</a> at Nabble.com.<br/>