Comments (10)
@Chirie - could you post any code that shows more specifically what you are trying? Could this be the same issue as #53
from django-google-maps.
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?
from django-google-maps.
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.
from django-google-maps.
Same issue here
from django-google-maps.
from django-google-maps.
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 id_geolocation
.
from django-google-maps.
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
id_geolocation
.
Oh, thanks for your reply. So there is no way to have 2 geolocation in the same django model?
from django-google-maps.
Hi @iryna-horbachova - that's right, you wouldn't be able to have multiples on the same model without modification.
from django-google-maps.
Similar happens if geolocation
field made read-only (as recommended in the description):
@register(Store)
class StoreAdmin(ModelAdmin):
list_display = ('name', 'address', 'geolocation')
readonly_fields = ('geolocation',)
jquery.js:4046 jQuery.Deferred exception: Cannot read property 'value' of null TypeError: Cannot read property 'value' of null
at Object.getExistingLocation (http://127.0.0.1:8001/static/django_google_maps/js/google-maps-admin.js:105:69)
at Object.initialize (http://127.0.0.1:8001/static/django_google_maps/js/google-maps-admin.js:41:41)
at HTMLDocument.<anonymous> (http://127.0.0.1:8001/static/django_google_maps/js/google-maps-admin.js:178:15)
at mightThrow (http://127.0.0.1:8001/static/admin/js/vendor/jquery/jquery.js:3762:29)
at process (http://127.0.0.1:8001/static/admin/js/vendor/jquery/jquery.js:3830:12) undefined
jQuery.Deferred.exceptionHook @ jquery.js:4046
jquery.js:4055 Uncaught TypeError: Cannot read property 'value' of null
at Object.getExistingLocation (google-maps-admin.js:105)
at Object.initialize (google-maps-admin.js:41)
at HTMLDocument.<anonymous> (google-maps-admin.js:178)
at mightThrow (jquery.js:3762)
at process (jquery.js:3830)
Django 3.1.7
from django-google-maps.
@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
from django-google-maps.
Related Issues (20)
- Is it possible to get country, city, zip code fields auto filed like the geocode? HOT 1
- On mouse click set marker with lat long HOT 3
- Plan on Django3 HOT 4
- Should it work on Python 3.8 and Django latest version ? HOT 12
- Plan on Django3.1 HOT 1
- ValueError while trying to migrate app HOT 3
- Error in Django 2.2.16
- Use another name than geolocation HOT 1
- delete
- How could the CSS styles be modified?
- Is there an example (or step to step tutorial) on how to use it? HOT 3
- Django admin AddressField not responsive HOT 1
- Having only the 'address' field in the form.py breaks the search in a template HOT 3
- Django 3.2 support HOT 1
- force_text() is deprecated in favor of force_str() HOT 1
- Issue with the documentation HOT 1
- Django 4.0 force_text HOT 3
- I have custom dashboard and map not loading.
- Widget template renders improperly inside a div HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-google-maps.