[OpenLayers-Users] Noob - Serving Tiles Without a 'Server'

christopher.schmidt at nokia.com christopher.schmidt at nokia.com
Sat Jun 5 10:28:04 EDT 2010


On Jun 5, 2010, at 10:21 AM, ext Arnie Shore wrote:

> Chris, that reads like it's the syntax for individual tiles.  

I don't know what specifically sounds like that, but it's not
the case. 

> But I'm 
> trying to replicate the slippy map in the open layers demo.



> I'm using the following single layer init() function:


>                map = new OpenLayers.Map("map_div");
>                var my_map_obj = new OpenLayers.Layer.OSM();

Just change your Layer.OSM call.  
 new OpenLayers.Layer.OSM("Name", "http://127.0.0.1/osm/tiles/${z}/${x}/${y}.png");

-- Chris

>                map.addLayer(my_map_obj);
>                map.setCenter(new OpenLayers.LonLat(-76.5,39.01)    // 
> Center of the map
>                    .transform(
>                        new OpenLayers.Projection("EPSG:4326"),        
>    // transform from WGS 1984
>                        new OpenLayers.Projection("EPSG:900913")        
> // to Spherical Mercator Projection
>                    ), 13 // Zoom level
>                );        // end    map.setCenter()
> 
> 
> Is this close to workable?  AS
> 
> 

Regards,
-- 
Christopher Schmidt
Nokia




More information about the Users mailing list