Ticket #13112: map_type.diff
File map_type.diff, 2.2 KB (added by , 15 years ago) |
---|
-
django/contrib/gis/templates/gis/google/google-map.js
10 10 if (GBrowserIsCompatible()) { 11 11 {{ js_module }}.{{ dom_id }} = new GMap2(document.getElementById("{{ dom_id }}")); 12 12 {{ js_module }}.{{ dom_id }}.setCenter(new GLatLng({{ center.1 }}, {{ center.0 }}), {{ zoom }}); 13 {{ js_module }}.{{ dom_id }}.setMapType({{ map_type }}); 13 14 {% block controls %}{{ js_module }}.{{ dom_id }}.setUIToDefault();{% endblock %} 14 15 {% if calc_zoom %}var bounds = new GLatLngBounds(); var tmp_bounds = new GLatLngBounds();{% endif %} 15 16 {% for kml_url in kml_urls %}{{ js_module }}.{{ dom_id }}_kml{{ forloop.counter }} = new GGeoXml("{{ kml_url }}"); -
django/contrib/gis/maps/google/gmap.py
22 22 center=None, zoom=None, dom_id='map', 23 23 kml_urls=[], polylines=None, polygons=None, markers=None, 24 24 template='gis/google/google-map.js', 25 js_module='geodjango', 25 js_module='geodjango', map_type='map', 26 26 extra_context={}): 27 27 28 28 # The Google Maps API Key defined in the settings will be used … … 86 86 self.zoom = zoom 87 87 if center is None: center = (0, 0) 88 88 self.center = center 89 90 if map_type == 'terrain': 91 self.map_type = 'G_PHYSICAL_MAP' 92 elif map_type == 'satellite': 93 self.map_type = 'G_SATELLITE_MAP' 94 else: 95 self.map_type = 'G_NORMAL_MAP' 89 96 90 97 def render(self): 91 98 """ … … 97 104 'js_module' : self.js_module, 98 105 'kml_urls' : self.kml_urls, 99 106 'zoom' : self.zoom, 107 'map_type' : self.map_type, 100 108 'polygons' : self.polygons, 101 109 'polylines' : self.polylines, 102 110 'icons': self.icons,