frojd / wagtail-geo-widget Goto Github PK
View Code? Open in Web Editor NEWWagtail-Geo-Widget is the complete map solution for your Wagtail site.
License: MIT License
Wagtail-Geo-Widget is the complete map solution for your Wagtail site.
License: MIT License
I've not had time to dig very deeply into the issue but I think it's because the recent work to add Wagtail compatibility has broken it.
If get time I will take a look. This part of the upgrade docs is the relevant info: https://docs.wagtail.org/en/stable/releases/3.0.html#api-changes-to-panels-edithandlers
It may be as simple as renaming this function:
as I think above whereSeems like it could be an easy fix.
Error reported under pip 18
Collecting wagtailgeowidget==4.0.2 (from -r ../config/requirements.txt (line 10))
Downloading https://files.pythonhosted.org/packages/47/b8/88c3a750e1e891506b468a9688e7a09f74afc994cec5af3e7b5a5612c450/wagtailgeowidget-4.0.2.tar.g
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "/tmp/pip-install-q0y9jw7k/wagtailgeowidget/setup.py", line 10, in <module>
from pip.req import parse_requirements
ModuleNotFoundError: No module named 'pip.req'
Thank you!!
Hi!
Is a very good work that you did here.
I want ask for template tag, i think, the complete package should have a rendering template tag for templates.
Some like {% gmap 'localtion | address' size zoom %}
, etc.
I'm trying making one but is hard for me.
Can you add this feature please?
Is your package support Django2?
I did not see it in the documentation, is it possible to add multiple markers?
Dependabot couldn't authenticate with https://pypi.python.org/simple/.
You can provide authentication details in your Dependabot dashboard by clicking into the account menu (in the top right) and selecting 'Config variables'.
Please, create a pypi package for easier installation of wagtail-geo-widget.
Work is done here: https://github.com/Frojd/wagtail-geo-widget/tree/feature/wagtail_2.0
When i run the service on my laptop/dev enviroment it works just fine. However when I deploy it on my production Debian server it shows the following error when typing in an address in a warning box just below the input.
"Could not geocode address "a". The map may not be in sync with the address entered."
When i check the console i get the following error.
Geocoding Service: This API project is not authorized to use this API.
For more information on authentication and Google Maps JavaScript API services please see: https://developers.google.com/maps/documentation/javascript/get-api-key
The strange part is, the map displays so it partially works.
They are both running same setup
Thank you for making this widget, it replaced me whole lot of other half-working options. But I did not find a way how to render map inside template, for now I have a custom inclusion tag to render the map.
Could you please make a wagtailgeowidget_tags
or something?
pip install wagtailgeowidget==4.0.2
Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-install-mb8vp6hq/wagtailgeowidget/setup.py", line 10, in <module> from pip.req import parse_requirements ModuleNotFoundError: No module named 'pip.req'
This seems to happend with pip 10
See here for a possible solution
Currently it's possible to zoom in and out the map widget, but after you save the map and open it again for edit, last zoom level in the map widget is not preserved but instead the hardcoded zoom level is used (either from settings or GeoPanel(zoom=...)).
What I need is to set the zoom level dynamically for each map, so that different maps can use different zoom levels. When I save the map, I want to read the "zoom" from map widget and store it to the database for the map. When the map is opened for edit, GeoPanel should read "zoom" from the database and initialise the widget with that zoom level instead of the default one. Optionally, there could be also "zoom" field shown in the edit page if user wants to set it via text input instead of using the map.
It's related with this: springload/wagtailgmaps#27 (comment)
There are currently plenty of text that are untranslated (only in English), lets make sure all user facing strings are translated.
couldn't follow the docs after installation because wagtailgeowidget.panels
was raising an error. did a bit of research and it seems to me that pip installs the develop
branch which uses wagtailgeowidgets.edit_handlers
.
this seems confusing to me, is this intentional?
Django 2.1 removes support for Widget.render()
methods without the renderer
argument (django/django@2bd207a), which breaks GeoField.render()
.
I have made a PR (#36) that fixes this.
Hi! I was following the readme, but the GeoPanel stops working when i add the address field to its definition. In the admin the address field will not be displayed and changes to the location will not be saved. There is no obvious error i could report - everything look fine apart from the missing input field.
Django 1.10.7 and wagtail 1.9.1
Expected result would be that GEO_WIDGET_DEFAULT_LOCATION
are set.
Description from user:
I just had to manually set the default location, by overriding the save method. I tried to set:GEO_WIDGET_DEFAULT_LOCATION = {'lat': 45.070312, 'lng': 7.6868565} but when I save the model without touching the location, the location field is set to None (maybe I did something wrong, but with 3 lines of code in the save model I solved the problem).
In CMS, we expect to configure less from the developer's end.
Instead of setting the variables in the settings, let's put this in a settings model so that the user can change them without developers getting involved.
Development is close to complete on the new react powered streamfield, and it's currently not compatible with the Geo Widget implementation.
I've reported the issue on wagtail-react-streamfield but there is a need for fixes on the wagtail-geo-widget.
More info over here: wagtail-deprecated/wagtail-react-streamfield#4
Thank you!!
With wagtail==4.0.4
and wagtailgeowidget==6.2.0
, I have setup linked address and position fields as in the docs, and tested with both Google Maps and Leaflet + Nominatim.
When I change the address, the pin moves on the map as expected.
However, if I move the pin, the address does not update. Is it supposed to, ie. is reverse geocoding supported?
If it isn't, it would be great to have an option to either prevent the user from moving the pin (so the map would just be a 'read-only' confirmation of the address), or to empty the address field if the pin is moved - so as to prevent situations where the address and position are out of sync.
Hi man, all is well, but you have a big problem here: parse_geosgeometry_string
.
This function doesn't exist, i get this problem:
So, viewing if something is wrong i found that these function doesn't exist.
I think you have to change documentation.
PD: Which the difference between spatial and nonspatial examples?
Usecase
We have a site where some articles have coordinates, and some articles do not have coordinates - however - every article should have the possibility to add them.
Problem
Every article that gets saved gets the default coordinates, which isn't optimal when we add the articles to a google map.
Solution
I'm thinking if we have a new setting like GEO_WIDGET_LOCATION_START_EMPTY = True
, then leave the location field empty until the location field or the address field gets focussed, then set it to the default from GEO_WIDGET_DEFAULT_LOCATION.
I feel like this might feel like a really weird interaction though, so not sure how to solve this properly, since the pin is needed.
Another option would be to have the input hidden and a button "Set pin", which then shows the location field with the default coordinates.
It seems the widget is not working correctly in Wagtail 3.0. I have tested the basic setup for both 3.0 and 2.16.2, and it does not render properly at 3.0, but works fine for 2.16.2 version.
Notice the difference between placeholder values in the fields, they're missing in 3.0.
class MapTestPage(Page):
map_address = CharField(max_length=250, blank=True, null=True)
map_location = CharField(max_length=250, blank=True, null=True)
map_zoom = SmallIntegerField(blank=True, null=True)
content_panels = Page.content_panels + [
MultiFieldPanel([
GeoAddressPanel('map_address', geocoder=GOOGLE_MAPS),
GoogleMapsPanel('map_location', address_field='map_address', zoom_field='map_zoom'),
FieldPanel('map_zoom'),
], 'Location'),
]
Wagtail 4 added FieldPanel permissions instead of overriding edit_handlers (https://docs.wagtail.org/en/stable/reference/pages/panels.html#field-panel). The FieldPanels provided by this project don't support this functionality. They shadow permissions attribute set on the FieldPanel.
A solution is proposed here #113
I have defined GEO_WIDGET_ZOOM to 15 on settings but the map not respect it.
I belive it's becouse the file edit_handlers.py
on line 21 no call the constant.
I'm writing a replacement for the map tool my university uses, since we're moving from Drupal to Wagtail, and we need to be able to draw complex polygons, including those with holes in them, for individual buildings. Can this widget, perhaps with heavy modifications by myself, be made to store and display such data? Or do you think I'd have to start entirely from scratch?
If I can build on top of this project to accomplish my goals, I'd be happy to offer my changes as a PR. However, we use purely GeoJSON for our existing map data, so I don't think we'll be using any of the GIS or GeoDjango stuff that's already in place in this library.
I just updated to Django 1.11.1 (from 1.10.7) and although the project and the geo widget was working fine before, it now complain on startup about:
django.contrib.gis.gdal.error.GDALException: Could not find the GDAL library (tried "gdal", "GDAL", "gdal1.11.0", "gdal1.10.0", "gdal1.9.0", "gdal1.8.0", "gdal1.7.0"). Try setting GDAL_LIBRARY_PATH in your settings.
The problem arises on startup while importing the GeoPanel in my homepage model.
I dont think i actually need GDAL (and dont want to install it) since it works fine when downgrading Django again, but something changed resulting in the need of GDAL in the new Django version. Do you know what happened? Is it actually caused by the geo widget or did some Django internals change so that i actually need to install GDAL tho im not using it?
I think it would be nice to have the option of displaying or not the coordinate field
Hi,
I tried this package and it works with PointField, as it's also mentioned in the docs.. but how can I use it with django.contrib.gis.db.MultiPolygonField ?
Using the Google Maps API, some location might have negative longitude. The geos_ptrn will fail in that case and map won't reflect the real coordinates.
I think that something like that, might do it:
geos_ptrn = re.compile(
"^SRID=([0-9]{1,});POINT(([0-9.-]{1,})\s([0-9.-]{1,}))$"
)
It seems the only way to change the default map right now is by passing along a default value to the model field. In some cases it's preferable to not have a default so you can keep it blank.
THis happend after i save the field. I didn't add the setting because i don't need it, i only want put the address and see the map, no more.
Field and Stream Block works fine before save de field, but after it, when page is reloaded, or accessed again, i get this error.
I found this documentation.
What can i do?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.