1
var proj_current = map.getProjectionObject();
3
// Layer to hold Draft Features
4
featuresLayer = new OpenLayers.Layer.Vector("Draft Features", {displayInLayerSwitcher: false});
5
map.addLayer(featuresLayer);
7
featuresLayer.events.register('featureadded', featuresLayer, function(){
8
// ToDo: Support 2 Modes via if: else:
9
// Add a point with popup (for use from map_viewing_client)
10
shn_gis_map_create_feature;
11
// Add a point without popup (for use from add_feature during module CRUD)
12
//shn_gis_map_add_geometry;
15
// Show Busy cursor whilst loading Draft Features
16
map.registerEvents(featuresLayer);
18
// FeatureGroup Layers
19
var parser = new OpenLayers.Format.WKT();
20
var geom, popupContentHTML, iconURL;
21
var featuresLayers = new Array();
23
{{for feature_group in feature_groups:}}
24
{{fgname = feature_group.name.replace(' ', '_').replace(':', '_')}}
25
var featuresLayer{{=fgname}} = new OpenLayers.Layer.Vector("{{=fgname}}", {displayInLayerSwitcher: true});
26
map.addLayer(featuresLayer{{=fgname}});
27
featuresLayers.push(featuresLayer{{=fgname}});
28
featuresLayer{{=fgname}}.events.on({ "featureselected": onFeatureSelect, "featureunselected": onFeatureUnselect });
29
{{for feature in features[feature_group.id]:}}
30
{{if feature.gis_location.id and feature.gis_location.wkt:}}
31
geom = parser.read('{{=feature.gis_location.wkt}}').geometry;
32
geom = geom.transform(proj4326, projection_current);
33
popupContentHTML = "{{include 'gis/ol_features_popup.html'}}";
34
iconURL = '{{=URL(r=request, c='default', f='download', args=[feature.marker])}}';
35
add_Feature_with_popup(featuresLayer{{=fgname}}, '{{=feature.gis_location.uuid}}', geom, popupContentHTML, iconURL);
40
allLayers = allLayers.concat(featuresLayers);
b'\\ No newline at end of file'