Ticket #16872: 16872.1.diff

File 16872.1.diff, 1.7 KB (added by jbronn, 13 years ago)

Touch edits supported, but adding geometries doesn't work.

  • django/contrib/gis/templates/gis/admin/openlayers.js

    diff -r cd821dfec22a django/contrib/gis/templates/gis/admin/openlayers.js
    a b  
    115115    {{ module }}.map.addLayer({{ module }}.layers.base);
    116116    {% block extra_layers %}{% endblock %}
    117117    {% if is_linestring %}OpenLayers.Feature.Vector.style["default"]["strokeWidth"] = 3; // Default too thin for linestrings. {% endif %}
    118     {{ module }}.layers.vector = new OpenLayers.Layer.Vector(" {{ field_name }}");
     118    {{ module }}.layers.vector = new OpenLayers.Layer.Vector(" {{ field_name }}", {
     119        styleMap: new OpenLayers.StyleMap({
     120            temporary: OpenLayers.Util.applyDefaults({
     121                pointRadius: 16
     122            }, OpenLayers.Feature.Vector.style.temporary)
     123        })});
    119124    {{ module }}.map.addLayer({{ module }}.layers.vector);
    120125    // Read WKT from the text field.
    121126    var wkt = document.getElementById('{{ id }}').value;
     
    159164    {% if mouse_position %}{{ module }}.map.addControl(new OpenLayers.Control.MousePosition());{% endif %}
    160165    {% if scale_text %}{{ module }}.map.addControl(new OpenLayers.Control.Scale());{% endif %}
    161166    {% if layerswitcher %}{{ module }}.map.addControl(new OpenLayers.Control.LayerSwitcher());{% endif %}
     167    {{ module }}.map.addControl(new OpenLayers.Control.TouchNavigation({
     168                dragPanOptions: {
     169                    enableKinetic: true
     170                }
     171            }))
    162172    // Then add optional behavior controls
    163173    {% if not scrollable %}{{ module }}.map.getControlsByClass('OpenLayers.Control.Navigation')[0].disableZoomWheel();{% endif %}
    164174    {% endblock %}
Back to Top