User:SK53/OpenLayers

From OpenStreetMap Wiki
Jump to: navigation, search

I'd always had the idea that OL was too techy for me. However I've recently started rendering tiles using Mapnik & I want to see how they look.

What I use

What I've done

Alias /tiles/ "dir-path/mapnik/maptiles/"

<Directory "dir-path/mapnik/maptiles/">

 AllowOverride None
 Options Indexes FollowSymLinks Multiviews 
 Order allow,deny
 Allow from all

</Directory>

   // create LOSM layer
   var losm = new OpenLayers.Layer.OSM(
       "OpenStreetMap (Local)",
       "http://localhost/tiles/${z}/${x}/${y}.png",

{ // options isBaseLayer: true,

       numZoomLevels:21
       }
   );
The various zoom level options seem to be slightly non-intuitive. The numZoomLevels was the one which enabled me to see z19 and z20 tiles. See this for example
Personal tools
Namespaces
Variants
Actions
site
Toolbox