[OGDev] Could maps be centred and scaled
Andrew Black - lists
andrew-lists at mail.black1.org.uk
Fri May 2 07:00:05 BST 2008
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());
More information about the OpenGuides-Dev
mailing list