I have a suggestion concerning maps (eg map of all points in a category). I would like to get the maps to be centred and scaled. For example, in the following, all the points are off the displayed map. http://london.randomness.org.uk/wiki.cgi?action=index;format=map;index_type=...
The following is a quick demo to play with http://www2.black1.org.uk/~andrew/map/exp_bounds.html Click on a few points, hit "Reposition map" then repeat.
In practice - you might want to make it configurable for the user - apply a minimum zoom (eg my demo produces a very large scale map if you give a single point)
What do people think.
Andrew
On Thu 01 May 2008, Andrew Black - lists andrew-lists@mail.black1.org.uk wrote:
I have a suggestion concerning maps (eg map of all points in a category). I would like to get the maps to be centred and scaled. For example, in the following, all the points are off the displayed map. http://london.randomness.org.uk/wiki.cgi?action=index;format=map;index_type=...
The following is a quick demo to play with http://www2.black1.org.uk/~andrew/map/exp_bounds.html Click on a few points, hit "Reposition map" then repeat.
So are you saying that you'd like RGL category/locale maps to have a "reposition map" button, or maybe that you'd like them to appear "repositioned" by default? (Where "repositioned" means "zoomed and scaled so that all points in the category/locale appear on the map".)
I don't have any major problem with them appearing repositioned by default. I do worry slightly about outliers, but outliers are generally data entry bugs and this would be a good way of spotting them. Also, your demo is an exact fit to the bounding box; I think we need a margin as well so that points actually on the bounding box appear properly instead of mostly off-map.
If I have understood correctly what you want - then could you supply a patch to do this? (I'm assuming you wrote the code in the demo and therefore understand how to do it - if not then I could probably have a poke through and try to pick out the relevant bits but I don't know when this will reach the top of my to-do list.)
Kake
Kake L Pugh wrote:
So are you saying that you'd like RGL category/locale maps to have a "reposition map" button, or maybe that you'd like them to appear "repositioned" by default? (Where "repositioned" means "zoomed and scaled so that all points in the category/locale appear on the map".)
I mean the latter. With the additional constraint that it should be no larger scale than at at present (or some other configured zoom). Otherwise one (or a few very close) points give you a large scale map with no context.
I don't have any major problem with them appearing repositioned by default. I do worry slightly about outliers, but outliers are generally data entry bugs and this would be a good way of spotting them. Also, your demo is an exact fit to the bounding box; I think we need a margin as well so that points actually on the bounding box appear properly instead of mostly off-map.
Yep - I spotted that one. I think I need to investigate how to include this.
If I have understood correctly what you want - then could you supply a patch to do this?
I intend to have a look at how to get it into OG code, but so far I have only looked at it from a JavaScript perspective. The crucial bit of code is map.setZoom(map.getBoundsZoomLevel(bounds)); map.setCenter(bounds.getCenter());
On Fri 02 May 2008, Andrew Black - lists andrew-lists@mail.black1.org.uk wrote:
I mean the latter. With the additional constraint that it should be no larger scale than at at present (or some other configured zoom). Otherwise one (or a few very close) points give you a large scale map with no context.
Yes - just have a minimum/maximum zoom level (can't remember which way the numbers go).
I intend to have a look at how to get it into OG code, but so far I have only looked at it from a JavaScript perspective.
If you get stuck, then grab the source of an RGL page, amend it to work the way you want it to, and send me a diff.
Kake
Kake L Pugh wrote:
On Fri 02 May 2008, Andrew Black - lists andrew-lists@mail.black1.org.uk wrote:
I mean the latter. With the additional constraint that it should be no larger scale than at at present (or some other configured zoom). Otherwise one (or a few very close) points give you a large scale map with no context.
Yes - just have a minimum/maximum zoom level (can't remember which way the numbers go).
It is confusing....
In the original version of GMAP (which I believe OG uses), 0 is the most zoomed in and a typical views is about 3-5. RGL defaults to 5.
In the new version GMAP2 which has been around for at least a year the most zoomed in is 17 and typical views are 14-12. The reason for the change is that they can in the future give zooms that are finer than 17 (0 in old money). Personally it would have been simpler to allow for negative zoom levels.
More details of differences are in http://code.google.com/apis/maps/documentation/upgrade.html
The old interface continues to be supported as a "legacy" version of GMAP2 new features are only being released on GMAP2.
Andrew Black - lists wrote:
I have a suggestion concerning maps (eg map of all points in a category). I would like to get the maps to be centred and scaled.
I have finally got round to a prototype of this http://www2.black1.org.uk/~andrew/map/rgl/rgl22.html
As Kake suggested, I have copied a page from RGL and hacked it. I have also added tooltips - if you hover over the icon you get the name of the place.
openguides-dev@lists.openguides.org