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)
Change History (9)
by , 11 years ago
Attachment: | widget-chrome-1.png added |
---|
comment:1 by , 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 , 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)
comment:3 by , 11 years ago
Triage Stage: | Unreviewed → Accepted |
---|---|
UI/UX: | unset |
comment:4 by , 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 , 3 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Closing for inactivity and no similar reports in recent times.
widget in chrome - right behaviour