File tree Expand file tree Collapse file tree 3 files changed +28
-3
lines changed Expand file tree Collapse file tree 3 files changed +28
-3
lines changed Original file line number Diff line number Diff line change 9
9
GeoJSONField = type (object )
10
10
try :
11
11
from django .contrib .gis .db .models import GeometryField
12
- from .forms .widgets import LeafletWidget
13
12
except ImportError :
14
13
GeometryField = type (object )
15
- from django .forms .widgets import Textarea as LeafletWidget
14
+
15
+ from .forms .widgets import LeafletWidget
16
16
17
17
18
18
class LeafletGeoAdmin (ModelAdmin ):
Original file line number Diff line number Diff line change 34
34
35
35
from django .conf import settings
36
36
from django .contrib .gis import gdal
37
- from django .contrib .gis .geos import GEOSGeometry , GEOSException
38
37
from django .forms .widgets import Widget
39
38
from django .template import loader
40
39
from django .utils import six
43
42
from django .utils .translation import ugettext_lazy as _
44
43
from django .core import validators
45
44
45
+ try :
46
+ from django .contrib .gis .geos import GEOSGeometry
47
+ except ImportError :
48
+ from .nogeos import GEOSGeometry
49
+
50
+ try :
51
+ from django .contrib .gis .geos import GEOSException
52
+ except ImportError :
53
+ from .nogeos import GEOSException
54
+
46
55
logger = logging .getLogger ('django.contrib.gis' )
47
56
48
57
Original file line number Diff line number Diff line change
1
+ # -*- coding: utf-8 -*-
2
+
3
+
4
+ class GEOSGeometry (object ):
5
+ """
6
+ A simple mock of django.contrib.gis.geos.GEOSGeometry to make
7
+ django-leaflet work with only django-geojson (without libgeos)
8
+ """
9
+ def __init__ (self , geo_input , srid = None ):
10
+ self .srid = srid
11
+ self .geojson = geo_input
12
+ return
13
+
14
+
15
+ class GEOSException (Exception ):
16
+ pass
You can’t perform that action at this time.
0 commit comments