[OSM-dev] [Talk-GB] cycling routes
Andy Allan
gravitystorm at gmail.com
Thu Aug 16 20:52:01 BST 2007
On 8/16/07, Christopher Schmidt <crschmidt at metacarta.com> wrote:
> On Thu, Aug 16, 2007 at 08:17:27PM +0100, Andy Allan wrote:
> > On 8/16/07, stanley12 at blueyonder.co.uk <stanley12 at blueyonder.co.uk> wrote:
> > > This has just been brough to my attention.
> > >
> > > http://maps.camdencyclists.org.uk/
> > >
> > > Had a quick look but nothing too understand it properly. Was wondering if
> > > it may be of use to those working on the cycle routes if you werent aware
> > > of it already.
> >
> > No, I hadn't seen it. Sites like this makes me wish things happen in
> > different orders - I hate how much time and effort people have put
> > into google maps before we've finished making better ones for them to
> > use instead!
> >
> > Has anyone any experience of making clicky-icons with our stack
> > (openlayers etc)? For instance, if I have a bunch of nodes tagged e.g.
> > (don't shoot me for the tagging)
> > shop=bike
> > name=Evan's Cycles
> > url = http://example.com/shopid=5
> > openinghours=9am-8pm
> >
> > ... and I want to put an icon on the map to click to make a popup -
> > how do I do this? Is it possible with openlayers?
>
> Yes.
>
> markers = new OpenLayers.Layer.Markers("zibo");
> map.addLayer(markers);
>
> feature = new OpenLayers.Feature(layer,
> new OpenLayers.LonLat(0,0));
> marker = feature.createMarker();
>
> markers.addMarker(marker);
> marker.events.register("mousedown", marker, function(evt) {
> if (popup == null) {
> popup = feature.createPopup(true);
> popup.setContentHTML("<a
> href='http://www.somethingconstructive.net' target='_blank'>click
> me</a>");
> markers.map.addPopup(popup);
> } else {
> markers.map.removePopup(popup);
> popup.destroy();
> popup = null;
> }
> Event.stop(evt);
>
> });
>
> marker at 0,0 with a popup with a link inside.
>
> (From http://openlayers.org/dev/examples/popups.html )
Cool. Any (easy!) way to control zoom range to show the icons - i.e.
only show them on z=13+ ? And is there an easy way to load 100 popups
without having to autogenerate the javascript for all the icons?
Sorry, my ideas run way ahead of my coding ability, and most of what I
do is just lift code wholesale from other examples!
> Next version will probably have popups like:
>
> http://www.ukvoyager.info/pages/map/usermap.aspx
Cool, I look forward to it.
Cheers,
Andy
More information about the dev
mailing list