1
// make map available for easy debugging
5
//var features = new Array();
6
var featuresLayer, currentFeature;
7
//var pointControl, lineControl, polygonControl;
8
//var selectControl, dragControl
10
var allLayers = new Array();
12
OpenLayers.ImgPath = '/{{=request.application}}/static/img/gis/openlayers/';
14
OpenLayers.IMAGE_RELOAD_ATTEMPTS = 3;
15
OpenLayers.Util.onImageLoadErrorColor = "transparent";
18
OpenLayers.ProxyHost = '{{=URL(r=request, c='gis', f='proxy?url=')}}';
20
// See http://crschmidt.net/~crschmidt/spherical_mercator.html#reprojecting-points
21
var proj4326 = new OpenLayers.Projection('EPSG:4326');
22
var projection_current = new OpenLayers.Projection('EPSG:{{=projection}}');
25
// Provided by URL (Bookmark) or from feature (display_feature()) or from config (map_viewing_client())
28
var center = new OpenLayers.LonLat(lon, lat);
29
center.transform(proj4326, projection_current);
31
// Calculate from Bounds (display_features())
32
var bottom_left = new OpenLayers.LonLat({{=lon_min}}, {{=lat_min}});
33
bottom_left.transform(proj4326, projection_current);
34
var left = bottom_left.lon;
35
var bottom = bottom_left.lat;
36
top_right = new OpenLayers.LonLat({{=lon_max}}, {{=lat_max}});
37
top_right.transform(proj4326, projection_current);
38
var right = top_right.lon;
39
var top = top_right.lat;
40
var bounds = OpenLayers.Bounds.fromArray([left, bottom, right, top]);
41
var center = bounds.getCenterLonLat();
46
displayProjection: proj4326,
47
projection: projection_current,
49
maxResolution: {{=maxResolution}},
50
maxExtent: new OpenLayers.Bounds({{=maxExtent}}),
51
numZoomLevels: {{=numZoomLevels}}