forked from erdem/django-map-widgets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.rst
141 lines (94 loc) · 3.72 KB
/
README.rst
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
Django Map Widgets
==================
Configurable, pluggable and more user friendly map widgets for Django PostGIS fields.
.. note::
Please check the `project home page <https://github.com/erdem/django-map-widgets/>`_ for latest updates.
* **Project Home Page** : `https://github.com/erdem/django-map-widgets <https://github.com/erdem/django-map-widgets/>`_.
* **Documentation**: `http://django-map-widgets.readthedocs.io <http://django-map-widgets.readthedocs.io/>`_.
Achievements
^^^^^^^^^^^^
| The aim of the Django map widgets is to make all Geo Django widgets more user-friendly and configurable.
|
| Django map widgets package has support for Mapbox and Google Map services currently, if you want to see more widgets and think you can help, feel free to contribute to the project.
| We would be happy to review and merge your contributions. :)
Installation
^^^^^^^^^^^^
.. code-block:: console
$ pip install django-map-widgets
Add ``map_widgets`` to your ``INSTALLED_APPS`` in settings.py
.. code-block:: python
INSTALLED_APPS = [
...
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'mapwidgets',
]
**Django Admin**
.. code-block:: python
from django.contrib.gis.db import models
from mapwidgets.widgets import GooglePointFieldWidget
class CityAdmin(admin.ModelAdmin):
formfield_overrides = {
models.PointField: {"widget": GooglePointFieldWidget}
}
**Django Forms**
.. code-block:: python
from mapwidgets.widgets import GooglePointFieldWidget, GoogleStaticOverlayMapWidget
class CityForm(forms.ModelForm):
class Meta:
model = City
fields = ("coordinates", "city_hall")
widgets = {
'coordinates': GooglePointFieldWidget,
'city_hall': GoogleStaticOverlayMapWidget,
}
Requirements
^^^^^^^^^^^^
Django Map Widgets needs Jquery dependency to work in your regular views. In Django Admin case, you don't need to provide the jQuery just because it's already available on ``django.jQuery`` namespace.
Screenshots
^^^^^^^^^^^
Google Map Point Field Widget
-----------------------------
.. image:: https://cloud.githubusercontent.com/assets/1518272/26807500/ad0af4ea-4a4e-11e7-87d6-632f39e438f7.gif
:width: 100 %
Google Map Static Overlay Widget
--------------------------------
.. image:: https://cloud.githubusercontent.com/assets/1518272/18732296/18f1813e-805a-11e6-8801-f1f48ed02a9c.png
:width: 100 %
Release Notes
^^^^^^^^^^^^^
=====
0.4.2
=====
* GooglePointFieldInlineWidget bug fixes for Django 4.2.x (#142)
* Added `.readthedocs.yaml` to cover new **Read the Docs** updates.
=====
0.4.1
=====
* Added scroll wheel zooming functionality switch to Google Point Map Settings. (#134)
* Added Chinese(ZH) localisation support. (#133)
=====
0.4.0
=====
* Supported MapBox Map for Geo Point Field
* Fixed undefined place object binding issue in javascript triggers. (#125)
* Documented MapBox point field map widget
* Updated various localize files.
======
v0.3.2
======
* Added `streetViewControl <https://developers.google.com/maps/documentation/javascript/streetview#StreetViewMapUsage>`_ switch option to GooglePointFieldWidget settings. (#124)
======
v0.3.1
======
* Removed `six` package usages. (#117)
* Added a new general widget setting in order to specify Google JS libraries. (#119)
* Implemented some improvements for the demo project.
======
v0.3.0
======
* Implemented a new demo project with Django 2.x.
* Fixed Django Admin jQuery conflicts. (#100)
* Fixed a new widget JS instance initialising issue for Django Admin Inlines. (#84)
* Added Python 3.8 env settings to TravisCI configuration.