Sunday 4 May 2008

OpenLayers

I've been playing around with OpenLayers. I want to embed a map into my sister's web site. She has a Physio clinic and I've offered to build her web site (we're still discussing the details). I thought I'd just plonk a bitmap extracted from OSM to help people find her clinic.

Firstly the village she lives and works was not mapped. I added a couple of roads with Yahoo putting the names on from memory, but it was only a small part of the village. She lives 250 miles away, so a quick mapping trip was not really on. To my surprise when I looked today, TallGuy has added much more of the village. Thanks!

Then I extracted a bitmap, but it just doesn't cut it. I'm so used to zooming and scrolling around that a flat, static bitmap is crap. So OpenLayers then.

I copied some stuff from the wiki and embedded a div to display the map, and bingo, a lovely map. I then put a marker on it to mark the clinic and here's the rub: when you zoom in beyond level 14 the marker disappears. I can't find out what causes it. Wading through the OpenLayers Javascript is guaranteed to give you a sore head and no joy, so I'll sleep on it.

1 comment:

  1. The options (specifically the maxResolution) on the map object must match that on the Layer object.
    As the co-author of the wiki examples, I'll stick the code in to fix it.

    ReplyDelete

Thank you for taking the time to add a comment.

I have decided, regrettably, to review comments before they are published to ensure that offensive or inappropriate comments do not get shown.

Genuine comments are always welcome and will be published as quickly as possible.