geomap should default to a sensible start map

Bug #744940 reported by Vidar Faltinsen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Network Administration Visualized
Fix Released
Wishlist
Trond Kandal

Bug Description

Today geomap always starts with a hard coded map centred around Trondheim. The best solution is to study all netboxes that are to be displayed and look at their room's coordinates and make a initial view that includes all these boxes. An alternative would be to add a config file option that lets the NAV administrator hard code a startup view.

Changed in nav:
importance: Undecided → Wishlist
Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :

I don't know much about programming with OpenLayers, but I see the JavaScript API has a Bounds class that could potentially solve this problem: http://dev.openlayers.org/docs/files/OpenLayers/BaseTypes/Bounds-js.html

An approach could be to output some Javascript that feeds all the room coordinates to a Bounds object which is fed to a zoomToExtent call. The Bounds class will automatically calculate the bounding box for a list of coordinates.

Changed in nav:
status: New → Triaged
Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :

It should be noted that geomap.js already has the option of using a bounding box if a bbox parameter is used in the URL.

So there are two options:

1. redirect the geomap frontpage to the same URL with a bbox-query created from the list of room locations.

or

2. make a geomap url that produces a short javascript snippet creating a bounding box from all the room locations, and using that bounding box as the default bounding box in geomap.js init() function (unless a parameters.bbox is set). Include this URL in the geomap document <head>.

The latter solution would perhaps be preferred, as it at least will be more robust against too long URLs in the case of an installation that has insanely many rooms.

Changed in nav:
status: Triaged → In Progress
assignee: nobody → Trond Kandal (trond-kandal)
Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :

This was actually fixed for the 3.10.0 release, but the milestone target was never set properly.

Changed in nav:
status: In Progress → Fix Released
milestone: none → 3.10.1
milestone: 3.10.1 → 3.10.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.