[OSM-dev] Projection Issues

Christopher Schmidt crschmidt at crschmidt.net
Wed May 31 20:06:44 BST 2006


On Wed, May 31, 2006 at 07:53:40PM +0100, Nick Whitelegg wrote:
> >Yep. The mapfile is just a configuration file, but OL will talk to any
> >WMS.
> 
> >The problem I was having with the new renderer is a 'zoom' parameter,
> >which I wasn't sure what effect it had :) But it does seem that the new
> >dev renderer works fine in OL:
> 
> >http://crschmidt.net/projects/openstreetmap/devrender
> 
> Looks good... will investigate this openlayers api further to see if it 
> will do stuff like pushpins, etc, which I would like to do for both 
> Freemap (free-map.org.uk) and OSM as a whole.

Yes.

:) 

More specifically:

 var markers = new OpenLayers.Layer.Markers( "Markers" );
 map.addLayer(markers);
 var size = new OpenLayers.Size(21,25); // icon size
 var offset = new OpenLayers.Pixel(-(size.w/2), -size.h);
   // Offset of top left of icon from latlon point
 var icon = new  OpenLayers.Icon('http://openlayers.org/dev/img/marker.png',size,offset);
 marker = new OpenLayers.Marker(new OpenLayers.LonLat(90,10),icon);
 markers.addMarker(marker);

Note that it also supports popups, and a variety of other stuff, and if
it doesn't support something you want, just give it to me, and it
probably will at some point in the near future. (Alternatively, open a
ticket at trac.openlayers.org.)
 
> It's in the freemap directory. Specifically: osm.php for the OSM layer and 
> srtm.php for the SRTM layer.

Okay. If you don't get to it in the near future, I'll go through and
patch 'em, and send a patch to the dev list.

-- 
Christopher Schmidt
Web Developer




More information about the dev mailing list