Comments (18)
Hi skizzy,
Doesn't
{{{
{% load easy_maps_tags %} {% easy_map "Russia, Ekaterinburg, Mira 32" 300 400 %} }}}work?
easy_map tag just accepts string with the address and this address can come from the model field or be hardcoded in template.
Original comment by: Mikhail Korobov
from django-easy-maps.
Thanks for the reply. Yeah, it's not working. Should I create a model or what? Sorry, I didn't get you. Hope to hear from you soon. Take care.
Original comment by: skizzy
from django-easy-maps.
One more thing, I'm developing on windows machine through localhost:8000. :)
Original comment by: skizzy
from django-easy-maps.
What is the result html of the template rendering?
Original comment by: Mikhail Korobov
from django-easy-maps.
Just A blank Page! Nothing more, nothing less. :)
Original comment by: skizzy
from django-easy-maps.
Just a white blank Page! Nothing more, nothing less. :)
Original comment by: skizzy
from django-easy-maps.
Can you please post the result html source code here?
Original comment by: Mikhail Korobov
from django-easy-maps.
Template:
{% load easy_maps_tags %}
{% easy_map "Russia, Ekaterinburg, Mira 32" 300 400 %}
{% easy_map address 200 200 5 using 'easy_maps/map.html' %}
Views:
def geomap(request):
return render_to_response('geomap.html')
When I visit, localhost:8000/geomap , It will only load a blank page! Just white blank page. That's all.
Original comment by: skizzy
from django-easy-maps.
Can you please post the HTML of this blank page? Use 'view source' or 'save as' in your browser. If the html looks good then check the javascript errors in browser console.
Original comment by: Mikhail Korobov
from django-easy-maps.
<!-- Google Maps API javascript -->
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<!-- HTML map container -->
<div id="map-canvas-1"
class="easy-map-googlemap">
<noscript>
<img alt="Map of Russia, Ekaterinburg, Mira 32" src="http://maps.google.com/maps/api/staticmap?center=,&zoom=16&markers=,&size=300x400&sensor=false">
</noscript>
</div>
<!-- Map creation script -->
<script type="text/javascript">
function initialize_map_1() {
var latlng = new google.maps.LatLng(, );
var mapElem = document.getElementById("map-canvas-1");
var mapOptions = {
zoom: 16,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(mapElem, mapOptions);
var marker = new google.maps.Marker({
position: latlng,
map: map,
title: "Russia, Ekaterinburg, Mira 32"
});
}
// initialize the map after page loading
google.maps.event.addDomListener(window, 'load', initialize_map_1);
</script>
Original comment by: skizzy
from django-easy-maps.
What do you think is wrong? :)
Original comment by: skizzy
from django-easy-maps.
Geocoder wasn't able to get the coordinates for some reason. Try deleting the Address instance in your admin and trying again (and maybe setting the EASY_MAPS_GOOGLE_KEY option).
Unfortunately geocoding error debugging is not supported well in django-easy-maps now (it only sets a 'geocode_error' flag on Address instance, the reason gets lost), patches that will improve this are welcome.
Original comment by: Mikhail Korobov
from django-easy-maps.
You mean I should delete the address instance through my admin dashboard? I've set the Google map API key. What other solution do you know about? Thanks big bro. You rock!
Original comment by: Anonymous
from django-easy-maps.
Its me skizzy. I'm commenting through mobile.
Original comment by: Anonymous
from django-easy-maps.
Oops, I missed your updates. Yes, I mean deleting the address instance through admin dashboard. Is the problem resolved?
Original comment by: Mikhail Korobov
from django-easy-maps.
I have the same problem with the same code, {{ lat }} and {{ long }} return nothing.
I don't have an address instance in the admin dashboard ( if I understand you well )
Original comment by: Anonymous
from django-easy-maps.
I have checked geopy, they recommend using resource="map/geo" instead of "map".
But Geopy is working anyway.
I got it:
"Russia, Ekaterinburg, Mira 32" as 2 solution according to geopy. May be I should render this kind of error on my template.
Plus I didn't wrote the address instance in the admin dashboard.
( Love this app by the way )
Original comment by: Anonymous
from django-easy-maps.
Yes, it returns multiple solutions, and geocode raises ValueError.
For me worked changing:
{{{
#!python
self.computed_address, (self.latitude, self.longitude,) = g.geocode(address)
}}}
to
{{{
#!python
self.computed_address, (self.latitude, self.longitude,) = g.geocode(address, exactly_one=False)[0]
}}}
in models.py
Original comment by: Dmytro Buts
from django-easy-maps.
Related Issues (20)
- 'NoneType' object has no attribute 'strip' HOT 1
- Entering an invalid address gives a Django error HOT 2
- Map with existing latitude/longitude HOT 8
- Upload failed (403): You are not allowed to edit 'django-easy-maps' package information HOT 1
- Upgrading to 9.0.2 gives an error on `migrate` HOT 1
- Driving directions?
- Update ``example`` project
- Assuming integer values for width/height HOT 7
- pip django-easy-map SyntaxError and Apps aren't loaded yet HOT 2
- Occassional failure to show maps even after successful geocoding HOT 1
- This page didn't load Google Maps correctly. See the JavaScript console for technical details. HOT 3
- Multiple API Inclusions / Modal Window HOT 3
- MissingKeyMapError HOT 1
- Error deploying app HOT 5
- initialize_map_1 is not a function HOT 8
- Compatibility problem with Django 3.0 HOT 2
- Package using to-be deprecated ugettext_lazy() HOT 1
- DeprecationWarning: using ABCs from 'collections' instead of from 'collections.abc' HOT 1
- Non-existent console.exception function call HOT 1
- The example is currently not working
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-easy-maps.