-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Map not Loading on the template #54
Comments
Hello @madisona, sorry for taking long to respond to your response. After much digging, I realized that in the django-form-wizard, the form fields ids are named as id_{form_name}-address and id_{form_name}-geolocation. This breaks the google-maps-admin.js file since it is expecting the id in the form of id_address and id_geolocation. I changed this in the .js file to reflect the form field names and it worked. Problem is, now, it breaks other parts that I am using the google maps widget. Is there a way to fix this? |
hi @japhethmutai I'm not sure of a great way to make the field id a variable you could specify and be able to pass that to an external js file. I'd love to know if you come across a solution for it, as it would be helpful to allow someone to specify the field id's they wanted. |
Same issue here |
The script expects you've named your fields exactly like the example. The stack trace leads me to believe your geocode field may not have an id of |
Oh, thanks for your reply. So there is no way to have 2 geolocation in the same django model? |
Hi @iryna-horbachova - that's right, you wouldn't be able to have multiples on the same model without modification. |
Similar happens if
Django 3.1.7 |
@dmugtasimov - the sample app admin.py shows how to make the geolocation field readonly and have it still work appropriately: https://github.com/madisona/django-google-maps/blob/master/sample/admin.py |
made frontend for bank export, added condition for e-conomic invoices…
Map doesn't load on the form as expected. I have tried this with the sample map in the app but it is working fine. Could there be any special requirement needed when using form wizard? I am trying to load the map on a form wizard, but I am not sure if that is the problem. Console gives me this as an error:
Uncaught TypeError: Cannot read property 'value' of null at Object.getExistingLocation (google-maps-admin.js:92) at Object.initialize (google-maps-admin.js:41) at HTMLDocument.<anonymous> (google-maps-admin.js:165) at j (jquery.min.js:2) at k (jquery.min.js:2)
I also noticed that another jquery.js is loaded, which is of lower version
3.1.0
as compared to thejquery
loaded that is used in the project which is v3.2.1The text was updated successfully, but these errors were encountered: