projection

This commit is contained in:
Sanj 2011-08-29 06:32:15 +05:30
parent 85541ed4b1
commit 7c93f2c7de
2 changed files with 2 additions and 2 deletions

View File

@ -58,7 +58,7 @@ class Feature(models.Model):
feature_type_name.short_description = "Feature Type" feature_type_name.short_description = "Feature Type"
def get_geojson(self): def get_geojson(self):
geom = json.loads(self.geometry.geojson) geom = json.loads(self.geometry.transform(3785, True).geojson)
properties = { properties = {
'id': self.id, 'id': self.id,
'preferred_name': self.preferred_name 'preferred_name': self.preferred_name

View File

@ -1,6 +1,6 @@
$(function() { $(function() {
map = new OpenLayers.Map('map', {}); map = new OpenLayers.Map('map', {});
var baseLayer = new OpenLayers.Layer.OSM( "Openstreetmap Base Layer"); var baseLayer = new OpenLayers.Layer.OSM( "Openstreetmap Base Layer", {isBaseLayer: true});
// map.addLayer(baseLayer); // map.addLayer(baseLayer);
var geojson_format = new OpenLayers.Format.GeoJSON(); var geojson_format = new OpenLayers.Format.GeoJSON();
var jsonLayer = new OpenLayers.Layer.Vector(); var jsonLayer = new OpenLayers.Layer.Vector();