Googlemaps: choose best available coords
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
webtrees |
Invalid
|
Undecided
|
Unassigned |
Bug Description
When creating a map, Googlemaps currently extracts coordinates for the lowest-level segment of the place name. If the name exists in the place hierarchy, but the location is undefined, a bogus map pointer over the Atlantic Ocean (latitude=0, longitude=0) is shown. If the name doesn't exist in the place hierarchy, no map pointer is shown. I believe this logic creates barriers to usage of Googlemaps, especially for those who choose to extend the place hierarchy below the city/town/village level.
The attached patch changes the manner in which Googlemaps selects coordinates for a given place name: at each step of the place hierarchy, the coordinates are evaluated. If the coordinates are not at the defaults (0,0), that place ID is remembered as the best available so far. When the hierarchical search terminates (due to everything matching or due to a name segment not being matched), the coordinates of the best available place ID are retrieved. If nothing in the hierarchy matches, no map pointer is shown.
The philosophy of this patch is that a less-accurate map pointer is better than none at all. Also, bogus map pointers over the Atlantic Ocean should never be shown under any circumstances.
Scott, I totally agree with your philosophy.
Give me a day or so to test this out, and then I will post it to svn.
OK?
And thankyou for the patch ;-))
Brian