Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
e6f5b7ea
Kaydet (Commit)
e6f5b7ea
authored
Mar 09, 2013
tarafından
Claude Paroz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #9806 -- Allowed editing GeometryField with OpenLayersWidget
Thanks Paul Winkler for the initial patch.
üst
f3d1aebe
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
17 deletions
+18
-17
options.py
django/contrib/gis/admin/options.py
+1
-0
widgets.py
django/contrib/gis/admin/widgets.py
+2
-1
openlayers.js
django/contrib/gis/templates/gis/admin/openlayers.js
+12
-16
1.6.txt
docs/releases/1.6.txt
+3
-0
No files found.
django/contrib/gis/admin/options.py
Dosyayı görüntüle @
e6f5b7ea
...
...
@@ -94,6 +94,7 @@ class GeoModelAdmin(ModelAdmin):
'scrollable'
:
self
.
scrollable
,
'layerswitcher'
:
self
.
layerswitcher
,
'collection_type'
:
collection_type
,
'is_generic'
:
db_field
.
geom_type
==
'GEOMETRY'
,
'is_linestring'
:
db_field
.
geom_type
in
(
'LINESTRING'
,
'MULTILINESTRING'
),
'is_polygon'
:
db_field
.
geom_type
in
(
'POLYGON'
,
'MULTIPOLYGON'
),
'is_point'
:
db_field
.
geom_type
in
(
'POINT'
,
'MULTIPOINT'
),
...
...
django/contrib/gis/admin/widgets.py
Dosyayı görüntüle @
e6f5b7ea
...
...
@@ -40,7 +40,8 @@ class OpenLayersWidget(Textarea):
)
value
=
None
if
value
and
value
.
geom_type
.
upper
()
!=
self
.
geom_type
:
if
(
value
and
value
.
geom_type
.
upper
()
!=
self
.
geom_type
and
self
.
geom_type
!=
'GEOMETRY'
):
value
=
None
# Constructing the dictionary of the map options.
...
...
django/contrib/gis/templates/gis/admin/openlayers.js
Dosyayı görüntüle @
e6f5b7ea
...
...
@@ -6,6 +6,7 @@ OpenLayers.Projection.addTransform("EPSG:4326", "EPSG:3857", OpenLayers.Layer.Sp
{{
module
}}.
wkt_f
=
new
OpenLayers
.
Format
.
WKT
();
{{
module
}}.
is_collection
=
{{
is_collection
|
yesno
:
"true,false"
}};
{{
module
}}.
collection_type
=
'{{ collection_type }}'
;
{{
module
}}.
is_generic
=
{{
is_generic
|
yesno
:
"true,false"
}};
{{
module
}}.
is_linestring
=
{{
is_linestring
|
yesno
:
"true,false"
}};
{{
module
}}.
is_polygon
=
{{
is_polygon
|
yesno
:
"true,false"
}};
{{
module
}}.
is_point
=
{{
is_point
|
yesno
:
"true,false"
}};
...
...
@@ -89,24 +90,19 @@ OpenLayers.Projection.addTransform("EPSG:4326", "EPSG:3857", OpenLayers.Layer.Sp
// Create an array of controls based on geometry type
{{
module
}}.
getControls
=
function
(
lyr
){
{{
module
}}.
panel
=
new
OpenLayers
.
Control
.
Panel
({
'displayClass'
:
'olControlEditingToolbar'
});
var
nav
=
new
OpenLayers
.
Control
.
Navigation
();
var
draw_ctl
;
if
({{
module
}}.
is_linestring
){
draw_ctl
=
new
OpenLayers
.
Control
.
DrawFeature
(
lyr
,
OpenLayers
.
Handler
.
Path
,
{
'displayClass'
:
'olControlDrawFeaturePath'
});
}
else
if
({{
module
}}.
is_polygon
){
draw_ctl
=
new
OpenLayers
.
Control
.
DrawFeature
(
lyr
,
OpenLayers
.
Handler
.
Polygon
,
{
'displayClass'
:
'olControlDrawFeaturePolygon'
});
}
else
if
({{
module
}}.
is_point
){
draw_ctl
=
new
OpenLayers
.
Control
.
DrawFeature
(
lyr
,
OpenLayers
.
Handler
.
Point
,
{
'displayClass'
:
'olControlDrawFeaturePoint'
});
{{
module
}}.
controls
=
[
new
OpenLayers
.
Control
.
Navigation
()];
if
(
!
{{
module
}}.
modifiable
&&
lyr
.
features
.
length
)
return
;
if
({{
module
}}.
is_linestring
||
{{
module
}}.
is_generic
){
{{
module
}}.
controls
.
push
(
new
OpenLayers
.
Control
.
DrawFeature
(
lyr
,
OpenLayers
.
Handler
.
Path
,
{
'displayClass'
:
'olControlDrawFeaturePath'
}));
}
if
({{
module
}}.
is_polygon
||
{{
module
}}.
is_generic
){
{{
module
}}.
controls
.
push
(
new
OpenLayers
.
Control
.
DrawFeature
(
lyr
,
OpenLayers
.
Handler
.
Polygon
,
{
'displayClass'
:
'olControlDrawFeaturePolygon'
}));
}
if
({{
module
}}.
is_point
||
{{
module
}}.
is_generic
){
{{
module
}}.
controls
.
push
(
new
OpenLayers
.
Control
.
DrawFeature
(
lyr
,
OpenLayers
.
Handler
.
Point
,
{
'displayClass'
:
'olControlDrawFeaturePoint'
}));
}
if
({{
module
}}.
modifiable
){
var
mod
=
new
OpenLayers
.
Control
.
ModifyFeature
(
lyr
,
{
'displayClass'
:
'olControlModifyFeature'
});
{{
module
}}.
controls
=
[
nav
,
draw_ctl
,
mod
];
}
else
{
if
(
!
lyr
.
features
.
length
){
{{
module
}}.
controls
=
[
nav
,
draw_ctl
];
}
else
{
{{
module
}}.
controls
=
[
nav
];
}
{{
module
}}.
controls
.
push
(
new
OpenLayers
.
Control
.
ModifyFeature
(
lyr
,
{
'displayClass'
:
'olControlModifyFeature'
}));
}
};
{{
module
}}.
init
=
function
(){
...
...
docs/releases/1.6.txt
Dosyayı görüntüle @
e6f5b7ea
...
...
@@ -134,6 +134,9 @@ Minor features
* SimpleLazyObjects will now present more helpful representations in shell
debugging situations.
* Generic :class:`~django.contrib.gis.db.models.GeometryField` is now editable
with the OpenLayers widget in the admin.
Backwards incompatible changes in 1.6
=====================================
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment