diff --git a/examples/freemap.html b/examples/freemap.html index 57aadde7c6..32f2681e9b 100644 --- a/examples/freemap.html +++ b/examples/freemap.html @@ -26,12 +26,25 @@ map = new OpenLayers.Map( 'map' ); var basemap = new OpenLayers.Layer.WMS( "Boston", "http://boston.freemap.in/cgi-bin/mapserv?", - {map: '/www/freemap.in/boston/map/gmaps.map', layers: 'border,water,roads,rapid_transit,buildings', format: 'png', 'transparent': 'off'}, + { + map: '/www/freemap.in/boston/map/gmaps.map', + layers: 'border,water,roads,rapid_transit,buildings', + format: 'png', + transparent: 'off' + }, // These are the important parts for creating a non-epsg:4326 // map: Maxextent is the boundary of the map/tile loading area, // maxResolution is the units/pixel at the highest zoom, and // projection is the projection to be used in WMS/WFS Requests. - {maxExtent: new OpenLayers.Bounds(33861, 717605, 330846, 1019656), maxResolution: 296985/1024, projection:"EPSG:2805" } ); + { + maxExtent: new OpenLayers.Bounds(33861, 717605, 330846, 1019656), + maxResolution: 296985/1024, // Another alternative is 'auto', which + // will automatically fit the map: you can + // then check map.baseLayer.resolutions[0] for + // a reasonable value. + projection:"EPSG:2805", // Used in WMS/WFS requests. + units: "m" // Only neccesary for working with scales. + } ); map.addLayer(basemap); @@ -43,5 +56,7 @@
+When using alternative projections, you still use OpenLayers.LonLat objects, even though + the properties are actually X/Y values at that point.