Skip to content

Commit

Permalink
Removed hardcoded SRID in the admin.
Browse files Browse the repository at this point in the history
  • Loading branch information
brutasse committed May 8, 2010
1 parent 8adf9ca commit 01fd3f9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions geoportal/templates/gis/admin/geoportal.js
Expand Up @@ -18,14 +18,14 @@ Hacked by Bruno Renié to make it work with the Géoportail API.
var match = {{ module }}.re.exec(wkt);
if (match){wkt = match[1];}
var wkt = {{ module }}.wkt_f.read(wkt);
wkt = new OpenLayers.Feature.Vector(wkt.geometry.transform(new OpenLayers.Projection('EPSG:4326'), {{ module }}.map.getProjection()));
wkt = new OpenLayers.Feature.Vector(wkt.geometry.transform(new OpenLayers.Projection('EPSG:{{ srid }}'), {{ module }}.map.getProjection()));
return wkt;
}
{{ module }}.write_wkt = function(feat){
if ({{ module }}.is_collection){ {{ module }}.num_geom = feat.geometry.components.length;}
else { {{ module }}.num_geom = 1;}
var feat2 = feat.clone();
var feat_epsg = new OpenLayers.Feature.Vector(feat2.geometry.transform({{ module }}.map.getProjection(), new OpenLayers.Projection('EPSG:4326')));
var feat_epsg = new OpenLayers.Feature.Vector(feat2.geometry.transform({{ module }}.map.getProjection(), new OpenLayers.Projection('EPSG:{{ srid }}')));
document.getElementById('{{ id }}').value = {{ module }}.get_ewkt(feat_epsg);
}
{{ module }}.add_wkt = function(event){
Expand Down Expand Up @@ -74,7 +74,7 @@ Hacked by Bruno Renié to make it work with the Géoportail API.
{{ module }}.deleteFeatures();
document.getElementById('{{ id }}').value = '';
var center = new OpenLayers.LonLat({{ default_lon }}, {{ default_lat }});
center = center.transform(new OpenLayers.Projection('EPSG:4326'), {{ module }}.map.getProjection());
center = center.transform(new OpenLayers.Projection('EPSG:{{ srid }}'), {{ module }}.map.getProjection());
{{ module }}.map.setCenter(center, {{ default_zoom }});
}
// Add Select control
Expand Down Expand Up @@ -158,7 +158,7 @@ Hacked by Bruno Renié to make it work with the Géoportail API.
}
} else {
var center = new OpenLayers.LonLat({{ default_lon }}, {{ default_lat }});
center = center.transform(new OpenLayers.Projection('EPSG:4326'), {{ module }}.map.getProjection());
center = center.transform(new OpenLayers.Projection('EPSG:{{ srid }}'), {{ module }}.map.getProjection());
{{ module }}.map.setCenter(center, {{ default_zoom }});
}
// This allows editing of the geographic fields -- the modified WKT is
Expand Down

0 comments on commit 01fd3f9

Please sign in to comment.