Ticket #11634: openlayers.diff

File openlayers.diff, 1.4 KB (added by dalkvist, 6 years ago)
  • django/contrib/gis/templates/gis/admin/openlayers.js

     
    6666{{ module }}.clearFeatures = function (){
    6767  {{ module }}.deleteFeatures();
    6868  document.getElementById('{{ id }}').value = '';
    69   {{ module }}.map.setCenter(new OpenLayers.LonLat({{ default_lon }}, {{ default_lat }}), {{ default_zoom }});
     69  {{ module }}.map.setCenter(new OpenLayers.LonLat({{ default_lon }}, {{ default_lat }}){% if display_srid
     70+%}.transform({{ module }}.map.displayProjection, {{ module }}.map.getProjectionObject()){% endif %}, {{ default_zoom }});
    7071}
    7172// Add Select control
    7273{{ module }}.addSelectControl = function(){   
     
    131132          {{ module }}.map.zoomTo({{ point_zoom }});
    132133      }
    133134    } else {
    134       {{ module }}.map.setCenter(new OpenLayers.LonLat({{ default_lon }}, {{ default_lat }}), {{ default_zoom }});
     135      {{ module }}.map.setCenter(new OpenLayers.LonLat({{ default_lon }}, {{ default_lat }}){% if display_srid
     136%}.transform({{ module }}.map.displayProjection, {{ module }}.map.getProjectionObject()){% endif %}, {{ default_zoom }});
    135137    }
    136138    // This allows editing of the geographic fields -- the modified WKT is
    137139    // written back to the content field (as EWKT, so that the ORM will know
Back to Top