Opened 11 years ago

Closed 3 years ago

#22357 closed Bug (worksforme)

Sometimes the OSMWidget highlights the outer area of a Polygon / MultiPolygon

Reported by: Marco Badan Owned by: nobody
Component: GIS Version: dev
Severity: Normal Keywords: osm
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I've seen this behaviour in Chrome (33.0.1750.152) and Firefox (28.0) on Linux.
I'll attach the images, the geojson file and the coordinates to reproduce this issue.

Attachments (4)

widget-chrome-1.png (171.8 KB ) - added by Marco Badan 11 years ago.
widget in chrome - right behaviour
widget-chrome-2.png (84.5 KB ) - added by Marco Badan 11 years ago.
widget in Chrome - wrong behaviour
widget-firefox.png (86.6 KB ) - added by Marco Badan 11 years ago.
widget in Firefox - wrong behaviour
shape.geojson.tar.gz (114.7 KB ) - added by Marco Badan 11 years ago.
compressed geojson

Download all attachments as: .zip

Change History (9)

by Marco Badan, 11 years ago

Attachment: widget-chrome-1.png added

widget in chrome - right behaviour

by Marco Badan, 11 years ago

Attachment: widget-chrome-2.png added

widget in Chrome - wrong behaviour

by Marco Badan, 11 years ago

Attachment: widget-firefox.png added

widget in Firefox - wrong behaviour

by Marco Badan, 11 years ago

Attachment: shape.geojson.tar.gz added

compressed geojson

comment:1 by Marco Badan, 11 years ago

The coordinates are around 39.21512,9.09424 http://www.openstreetmap.org/search?query=39.2142%2C9.0999#map=16/39.2142/9.0999

The field is a MultiPolygon.

comment:2 by Marco Badan, 11 years ago

models.py

from django.contrib.gis.db import models as gis_models
from django.db import models

class County(models.Model):
    name = models.CharField(max_length=255, blank=True)
    code = models.CharField(max_length=30)
    shape = gis_models.MultiPolygonField(blank=True, null=True, geography=True, srid=4326)

admin.py

from django.contrib.gis import admin
admin.site.register(County, admin.OSMGeoAdmin)
Last edited 11 years ago by Marco Badan (previous) (diff)

comment:3 by Aymeric Augustin, 11 years ago

Triage Stage: UnreviewedAccepted
UI/UX: unset

comment:4 by Reinout van Rees, 10 years ago

Your screenshots aren't totally clear as they don't show the full picture. Probably, in the "right" case the polygon's contents are highlighted and in the two "wrong" cases the area *around* the polygon is highlighted instead?

My first thought is about the order in which the polygon's points are placed. Clockwise or counter-clockwise. In one of the two, the polygon should be treated as a hole instead of an area.

But... you're using exactly the same database content. So the order of points cannot have changed. Django's database layer will return the same result, independent of the browser used.

The problem thus must be in the javascript that renders the map: openlayers. Django uses openlayers.

Openlayers is loaded with a url: https://docs.djangoproject.com/en/dev/ref/contrib/gis/admin/#django.contrib.gis.admin.GeoModelAdmin.openlayers_url , currently http://openlayers.org/api/2.11/OpenLayers.js

I'd say: check if a newer openlayers version still has the problem or if it is fixed.

To me, this almost cannot be a django problem. I'd suggest closing the ticket.

comment:5 by Claude Paroz, 3 years ago

Resolution: worksforme
Status: newclosed

Closing for inactivity and no similar reports in recent times.

Note: See TracTickets for help on using tickets.
Back to Top