Code

Ticket #11634: openlayers.diff

File openlayers.diff, 1.4 KB (added by dalkvist, 5 years ago)
Line 
1Index: django/contrib/gis/templates/gis/admin/openlayers.js
2===================================================================
3--- django/contrib/gis/templates/gis/admin/openlayers.js        (revision 11391)
4+++ django/contrib/gis/templates/gis/admin/openlayers.js        (arbetskopia)
5@@ -66,7 +66,8 @@
6 {{ module }}.clearFeatures = function (){
7   {{ module }}.deleteFeatures();
8   document.getElementById('{{ id }}').value = '';
9-  {{ module }}.map.setCenter(new OpenLayers.LonLat({{ default_lon }}, {{ default_lat }}), {{ default_zoom }});
10+  {{ module }}.map.setCenter(new OpenLayers.LonLat({{ default_lon }}, {{ default_lat }}){% if display_srid
11++%}.transform({{ module }}.map.displayProjection, {{ module }}.map.getProjectionObject()){% endif %}, {{ default_zoom }});
12 }
13 // Add Select control
14 {{ module }}.addSelectControl = function(){   
15@@ -131,7 +132,8 @@
16           {{ module }}.map.zoomTo({{ point_zoom }});
17       }
18     } else {
19-      {{ module }}.map.setCenter(new OpenLayers.LonLat({{ default_lon }}, {{ default_lat }}), {{ default_zoom }});
20+      {{ module }}.map.setCenter(new OpenLayers.LonLat({{ default_lon }}, {{ default_lat }}){% if display_srid
21+%}.transform({{ module }}.map.displayProjection, {{ module }}.map.getProjectionObject()){% endif %}, {{ default_zoom }});
22     }
23     // This allows editing of the geographic fields -- the modified WKT is
24     // written back to the content field (as EWKT, so that the ORM will know