2014_02_18: progress and success

Remember the problem with geocoding? It may just be fixed.

My main script has a function to set the bounds of the displayed map. If you try to drag the map so that areas outside these bounds are displayed, the map will snap back to the area I want it to display.

I had a look through the geocoder script – it has an options object, one line of which sets bounds to null. So I made this line call the setScotlandBounds function from my main script. After a bit of futzing to understand how one script can call a function in another script (the secret is to make the web page call them in the right order!), it works. EH10 5DT is where it should be. Searching for London gets London in Orkney.

I am so relieved – hacking the geocoder script or playing with Nominatim looked fearsome.

Next step is to hack geocoder or my main script so it doesn’t zoom in ridiculously. And that’s quite simple – just set a maxZoom in the map options object.

And the final MUST do – adding a pin at the user’s entered location sort of works. Because the map will definitely zoom when displaying the desired location, adding an onzoom event to put a marker works. But if you zoom in again, another marker will be placed.

The solution to that will be to place the marker into a layer. The next zoom would remove that layer.

2014_02_17 – not so much progress

More actual CC website (i.e. not work) stuff this morning, then back to litRev.

Looked at to-do list – I’ve not tested the postcode to latlong batch converter (http://www.doogal.co.uk/BatchGeocoding.php). Doing so just now with updated DumGal postcodes.

Looks OK visually:


but not exact match with inherited data (lats average 1.14% off, longs average 0.53% off).

I think that’s close enough because we don’t want to be too accurate!