Ticket #13247: django_gis_google_map_maxheight_dragcross.patch

File django_gis_google_map_maxheight_dragcross.patch, 3.2 KB (added by wardi, 15 years ago)

Add maxHeight and dragCrossSize options to google-map.js template

  • django/contrib/gis/templates/gis/google/google-map.js

     
    11{% autoescape off %}
    22{% block vars %}var geodjango = {};{% for icon in icons %}
    33var {{ icon.varname }} = new GIcon(G_DEFAULT_ICON);
    4 {% if icon.image %}{{ icon.varname }}.image = "{{ icon.image }}";{% endif %}
    5 {% if icon.shadow %}{{ icon.varname }}.shadow = "{{ icon.shadow }}";{% endif %} {% if icon.shadowsize %}{{ icon.varname }}.shadowSize = new GSize({{ icon.shadowsize.0 }}, {{ icon.shadowsize.1 }});{% endif %}
    6 {% if icon.iconanchor %}{{ icon.varname }}.iconAnchor = new GPoint({{ icon.iconanchor.0 }}, {{ icon.iconanchor.1 }});{% endif %} {% if icon.iconsize %}{{ icon.varname }}.iconSize = new GSize({{ icon.iconsize.0 }}, {{ icon.iconsize.1 }});{% endif %}
    7 {% if icon.infowindowanchor %}{{ icon.varname }}.infoWindowAnchor = new GPoint({{ icon.infowindowanchor.0 }}, {{ icon.infowindowanchor.1 }});{% endif %}{% endfor %}
     4{% if icon.image %}{{ icon.varname }}.image = "{{ icon.image }}";
     5{% endif %}{% if icon.shadow %}{{ icon.varname }}.shadow = "{{ icon.shadow }}";
     6{% endif %}{% if icon.shadowsize %}{{ icon.varname }}.shadowSize = new GSize({{ icon.shadowsize.0 }}, {{ icon.shadowsize.1 }});
     7{% endif %}{% if icon.iconanchor %}{{ icon.varname }}.iconAnchor = new GPoint({{ icon.iconanchor.0 }}, {{ icon.iconanchor.1 }});
     8{% endif %}{% if icon.iconsize %}{{ icon.varname }}.iconSize = new GSize({{ icon.iconsize.0 }}, {{ icon.iconsize.1 }});
     9{% endif %}{% if icon.infowindowanchor %}{{ icon.varname }}.infoWindowAnchor = new GPoint({{ icon.infowindowanchor.0 }}, {{ icon.infowindowanchor.1 }});
     10{% endif %}{% if icon.iconsize %}{{ icon.varname }}.iconSize = new GSize({{ icon.iconsize.0 }}, {{ icon.iconsize.1 }});
     11{% endif %}{% ifnotequal icon.maxheight None %}{{ icon.varname }}.maxHeight = {{ icon.maxheight }};
     12{% endifnotequal %}{% if icon.dragcrosssize %}{{ icon.varname }}.dragCrossSize = new GSize({{ icon.dragcrosssize.0 }}, {{ icon.dragcrosssize.1 }});
     13{% endif %}{% endfor %}
    814{% endblock vars %}{% block functions %}
    915{% block load %}{{ js_module }}.{{ dom_id }}_load = function(){
    1016  if (GBrowserIsCompatible()) {
  • django/contrib/gis/maps/google/overlays.py

     
    222222    """
    223223    def __init__(self, varname, image=None, iconsize=None,
    224224                 shadow=None, shadowsize=None, iconanchor=None,
    225                  infowindowanchor=None):
     225                 infowindowanchor=None, maxheight=None,
     226                 dragcrosssize=None):
    226227        self.varname = varname
    227228        self.image = image
    228229        self.iconsize = iconsize
     
    230231        self.shadowsize = shadowsize
    231232        self.iconanchor = iconanchor
    232233        self.infowindowanchor = infowindowanchor
     234        self.maxheight = maxheight
     235        self.dragcrosssize = dragcrosssize
    233236
    234237    def __cmp__(self, other):
    235238        return cmp(self.varname, other.varname)
Back to Top