flask-extensions / Flask-GoogleMaps

Easy way to add GoogleMaps to Flask applications. maintainer: @getcake
https://flask-googlemaps.com
MIT License
647 stars 196 forks source link

Unicode error on new version #42

Closed mariohmol closed 8 years ago

mariohmol commented 8 years ago

I made a upgrade to the new version and i'm getting a JS error now:

`var raw_markers = [{'lat': u'-19.9520738', 'lng': u'-43.9490132', 'icon': '//maps.google.com/mapfiles/ms/icons/red-dot.png'}];``

You can see that it is including u in front of lat lng.

I checked in the source and it seems to be correct gmap.markers|tojson|safe , but when using pip install flask-googlemaps --upgrade it is not installing the same version that we have here.

Is something needed to update on pip? Maybe need to change the version? (from 0.2.2 to 0.2.3) ?

rochacbruno commented 8 years ago

Hi @mariohmol I just released 0.2.3 with the latest changes from master.

rochacbruno commented 8 years ago

Looks fine in 0.2.3 thanks for bringing it up

mariohmol commented 8 years ago

Is that not compatible with py2.6 anymore? getting a error from flask.ext.googlemaps import GoogleMaps File "/usr/lib/python2.6/site-packages/flask/exthook.py", line 77, in load_module import(realname) File "/usr/lib/python2.6/site-packages/flask_googlemaps/init.py", line 263 if {'north', 'east', 'south', 'west'} != set(kwargs['bounds'].keys()): ^ SyntaxError: invalid syntax

rochacbruno commented 8 years ago

@mariohmol good question, I dont know.

this line

if {'north', 'east', 'south', 'west'} != set(kwargs['bounds'].keys()):

can be replaced by

if set(('north', 'east', 'south', 'west')) != set(kwargs['bounds'].keys()):

If this is the only thing needed I thing we can change it and make it compatible again.

mariohmol commented 8 years ago

please!! =)

mariohmol commented 8 years ago

Here as well... changed here and worked https://github.com/rochacbruno/Flask-GoogleMaps/blob/master/flask_googlemaps/__init__.py#L391

rochacbruno commented 8 years ago

@mariohmol check 0.2.4 (let me know if it works)

mariohmol commented 8 years ago

worked! thanks