~zubairassad89/sahana-eden/vms_gsoc

« back to all changes in this revision

Viewing changes to views/gis/ol_layers_features.js

  • Committer: Patricia Tressel
  • Date: 2010-08-15 13:34:25 UTC
  • mfrom: (768.1.211 eden)
  • Revision ID: tressel@phobos-20100815133425-z1eazm12k5pewg62
Merge from trunk, except for models/vol.py.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
var proj_current = map.getProjectionObject();
2
 
 
3
 
// Layer to hold the Features
4
 
featuresLayer = new OpenLayers.Layer.Vector("Locations", {
5
 
    strategies: [ strategy ],
6
 
    displayInLayerSwitcher: false
7
 
});
8
 
map.addLayer(featuresLayer);
9
 
 
10
 
var parser = new OpenLayers.Format.WKT();
11
 
var geom, popupContentHTML, iconURL;
12
 
 
13
 
{{for feature in features:}}
14
 
  {{if feature.wkt:}}
15
 
    geom = parser.read('{{=feature.wkt}}').geometry;
16
 
  {{else:}}
17
 
    geom = parser.read('POINT({{=feature.lon}}, {{=feature.lat}})').geometry;
18
 
  {{pass}}
19
 
    geom = geom.transform(proj4326, projection_current);
20
 
    popupContentHTML = "{{include 'gis/ol_features_popup.html'}}";
21
 
    iconURL = '{{=URL(r=request, c='default', f='download', args=[feature.marker])}}';
22
 
    add_Feature_with_popup(featuresLayer, '{{=feature.uuid}}', geom, popupContentHTML, iconURL);
23
 
{{pass}}
24
 
    
25
 
// Select Control for Internal FeatureGroup Layers
26
 
select = new OpenLayers.Control.SelectFeature(featuresLayer, {
27
 
        clickout: true,
28
 
        toggle: true,
29
 
        multiple: false,
30
 
        onSelect: onFeatureControlSelect,
31
 
        onUnselect: onFeatureControlUnselect
32
 
    }
33
 
);
34
 
map.addControl(select);
35
 
select.activate();