Auto Center and Zoom with YM4R

When I blogged last month about abstracting mapping with YM4R I commented: What I’ve not yet discovered (and may not be implemented) is a way to automatically center and zoom a map. It would be very nice to be able to add a batch of points to a map and have the plugin automatically work out their mid-point. Maybe I need to work on that a little… What I was missing was the center_zoom_on_bounds_init method. There are various ways to interact with it, but I’ve chosen: ...

Abstracting mapping with YM4R

When Grand Rapids WiFi–then a PHP application–first implemented google map support all the logic for producing those maps came in the templates. The controller passed the view a list of locations for that page, and it wrote out a series of javascript calls that produced the map. It was a little unreliable and very clunky, but it worked. When I moved the app over to rails, that was one aspect that I didn’t change, and it continued to work. ...