Erik Simmler avatar Erik Simmler committed bad1a2c

Fixed misnamed variables and added string formatting to avoid unwanted localization of floats.

Comments (0)

Files changed (1)

easy_maps/templates/easy_maps/map.html

+{% with lat=map.latitude|stringformat:"f" long=map.longitude|stringformat:"f" %}
 {% block api_js %}
     <!-- Google Maps API javascript -->
     <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
             style="width: {{ width }}px; height: {{ height }}px;"
          {% endif %}
          class="easy-map-googlemap">
+         {% block noscript %}
          <noscript>
-            <img alt="Map of {{ map.address }}" src="http://maps.google.com/maps/api/staticmap?center={{ map.longitude }},{{ latitude }}&zoom={{ zoom }}&markers={{ map.address }}&size={{ width }}x{{ height }}&sensor=false">
+            <img alt="Map of {{ map.address }}" src="http://maps.google.com/maps/api/staticmap?center={{ lat }},{{ long }}&zoom={{ zoom }}&markers={{ lat }},{{ long }}&size={{ width }}x{{ height }}&sensor=false">
          </noscript>
+         {% endblock noscript %}
     </div>
 {% endblock %}
 
     <!-- Map creation script -->
     <script type="text/javascript">
         function initialize_map_{{ map.pk }}() {
-            var latlng = new google.maps.LatLng({{ map.latitude|stringformat:"f" }}, {{ map.longitude|stringformat:"f" }});
+            var latlng = new google.maps.LatLng({{ lat }}, {{ long }});
             var mapElem = document.getElementById("map-canvas-{{ map.pk }}");
 
             {% block map_options_js %}
         {% endblock %}
     </script>
 {% endblock %}
+{% endwith %}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.