Skip to content
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

initialize_map_1 is not a function #73

Closed
pascalvogel1992 opened this issue Apr 12, 2019 · 8 comments · Fixed by #74
Closed

initialize_map_1 is not a function #73

pascalvogel1992 opened this issue Apr 12, 2019 · 8 comments · Fixed by #74
Assignees

Comments

@pascalvogel1992
Copy link

pascalvogel1992 commented Apr 12, 2019

Sadly I can't get the app to work in my setup with Django 2.2. I receive the below error in the JavaScript console. Any ideas how to fix this?

App is in INSTALLED_APPS, EASY_MAPS_GOOGLE_KEY is set (nothing else).

My template basically looks like this:

{% load easy_maps_tags %}
{% easy_map "Russia, Ekaterinburg, Mira 32" 300 400 %}

Error message:
image

Do I need to load Google Maps Javascript myself?

@bashu
Copy link
Owner

bashu commented Apr 12, 2019

@pascalvogel1992 can you run example project https://github.com/bashu/django-easy-maps/tree/develop/example and tell me if error still occurs?

@bashu
Copy link
Owner

bashu commented Apr 12, 2019

@pascalvogel1992 did you override "templates/easy_maps/map.html" ?

@pascalvogel1992
Copy link
Author

The example works.
I did not override the template, should I?

@pascalvogel1992
Copy link
Author

Any ideas how I should go about debugging what in my setup is causing this?

@bashu
Copy link
Owner

bashu commented Apr 13, 2019

@pascalvogel1992 you can, but not need to. Can you send me rendered HTML?

@bashu bashu self-assigned this Apr 13, 2019
@bashu bashu added the question label Apr 13, 2019
@pascalvogel1992
Copy link
Author

<!-- HTML map container -->
<div id="map-canvas-1"
class="easy-map-googlemap">
<!-- geocoding error -->
</div>

<script type="text/javascript" src="https://maps.google.com/maps/api/js?key=AIzaSyDahh4c5G8YZJih0vnKBKPo6EGMLAeaL-Q&language=en&callback=initialize_map_1" async defer></script>

@jackton1
Copy link
Contributor

@pascalvogel1992 Could you verify that the callback function is rendered on the page i.e This could be a case where the address isn't computed.

{% block map_js %}{% if map.computed_address %}

@bashu
Copy link
Owner

bashu commented Apr 15, 2019

@bashu bashu added the bug label Apr 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants