Skip to content

Commit 841efdc

Browse files
committed
New release 0.2.5
1 parent 41ebbbe commit 841efdc

File tree

6 files changed

+84
-11
lines changed

6 files changed

+84
-11
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,4 @@ media/*
4141
.mr.developer.cfg
4242
.project
4343
.pydevproject
44+
venv

Makefile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
.PHONY: test pep8 clean install build publish tree reenv
2+
3+
test: pep8
4+
py.test --cov=flask_googlemaps -l --tb=short --maxfail=1 tests/
5+
6+
pep8:
7+
@flake8 flask_googlemaps --ignore=F403
8+
9+
clean:
10+
@find ./ -name '*.pyc' -exec rm -f {} \;
11+
@find ./ -name 'Thumbs.db' -exec rm -f {} \;
12+
@find ./ -name '*~' -exec rm -f {} \;
13+
@rm -rf dist/
14+
@rm -rf *.egg
15+
@rm -rf *.egg-info
16+
17+
install:
18+
@pip install flit pypandoc pygments
19+
@flit install -s
20+
21+
build:
22+
@flit build
23+
24+
publish:
25+
@flit publish
26+
27+
tree:
28+
@tree -L 1 -a -I __pycache__ --dirsfirst --noreport
29+
30+
reenv:
31+
@rm -rf venv
32+
@python3.6 -m venv venv

README.md

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,38 @@ Easy to use Google Maps in your Flask application
77

88
Look the Live DEMO: http://flaskgooglemaps.pythonanywhere.com
99

10-
### requires
10+
## requires
11+
1112
- Jinja
1213
- Flask
1314
- A google api key [get here](https://developers.google.com/maps/documentation/javascript/get-api-key)
1415

1516

16-
### Installation
17+
## Installation
1718

1819
```pip install flask-googlemaps```
1920

2021
or
2122

2223
```bash
24+
2325
git clone https://github.com/rochacbruno/Flask-GoogleMaps
2426
cd Flask-GoogleMaps
2527
python setup.py install
26-
```
2728

29+
```
2830

29-
### How it works
31+
## How it works
3032

3133
Flask-GoogleMaps includes some global functions and template filters in your Jinja environment, also it allows you to use the Map in views if needed.
3234

3335

34-
#### registering
36+
### registering
3537

3638
in your app
3739

3840
```python
41+
3942
from flask import Flask
4043
from flask_googlemaps import GoogleMaps
4144

@@ -55,7 +58,9 @@ GoogleMaps(app, key="8JZ7i18MjFuM35dJHq70n3Hx4")
5558
In template
5659

5760
```html
61+
5862
{{googlemap("my_awesome_map", lat=0.23234234, lng=-0.234234234, markers=[(0.12, -0.45345), ...])}}
63+
5964
```
6065

6166
That's it! now you have some template filters and functions to use, more details in examples and screenshot below.
@@ -71,6 +76,7 @@ That's it! now you have some template filters and functions to use, more details
7176
#### 1. View
7277

7378
```python
79+
7480
from flask import Flask, render_template
7581
from flask_googlemaps import GoogleMaps
7682
from flask_googlemaps import Map
@@ -110,9 +116,10 @@ def mapview():
110116

111117
if __name__ == "__main__":
112118
app.run(debug=True)
119+
113120
```
114121

115-
##### `Map()` Parameters:
122+
##### `Map()` Parameters
116123

117124
- **lat**: The latitude coordinate for centering the map.
118125
- **lng**: The longitutde coordinate for centering the map.
@@ -143,6 +150,7 @@ Also controls True or False:
143150
#### 2. Template
144151

145152
```html
153+
146154
<!DOCTYPE html>
147155
<html>
148156
<head>
@@ -159,7 +167,6 @@ Also controls True or False:
159167
<h2> Template filter decoupled with single marker </h2>
160168
{{"decoupled-map"|googlemap_html(37.4419, -122.1419)}}
161169

162-
163170
<h2> Template function with multiple markers </h2>
164171
{% with map=googlemap_obj("another-map", 37.4419, -122.1419, markers=[(37.4419, -122.1419), (37.4300, -122.1400)]) %}
165172
{{map.html}}
@@ -180,8 +187,9 @@ Also controls True or False:
180187

181188
### Infobox
182189

183-
Here's an example snippet of code:
190+
Here's an example snippet of code:
184191
```python
192+
185193
Map(
186194
identifier="catsmap",
187195
lat=37.4419,
@@ -213,11 +221,15 @@ Here's an example snippet of code:
213221
Which results in something like the following map:
214222
<img width="1439" alt="screen shot 2015-07-29 at 2 41 52 pm" src="https://cloud.githubusercontent.com/assets/8108300/8969650/13b0de7a-3602-11e5-9ed0-9f328ac9253f.png">
215223

224+
216225
### Fit all markers within bounds
226+
217227
Allow users to easily fit all markers within view on page load
218228

219229
#### Without bounds
230+
220231
```python
232+
221233
@app.route('/map-unbounded/')
222234
def map_unbounded():
223235
"""Create map with markers out of bounds."""
@@ -228,11 +240,15 @@ def map_unbounded():
228240
markers=[(loc.latitude, loc.longitude) for loc in locations]
229241
)
230242
return render_template('map.html', map=map)
243+
231244
```
245+
232246
![image](https://user-images.githubusercontent.com/14223309/29294427-24a8d4e0-8104-11e7-967b-0c55c20d0f7c.png)
233247

234248
#### With bounds
249+
235250
```python
251+
236252
@app.route('/map-bounded/')
237253
def map_bounded():
238254
"""Create map with all markers within bounds."""
@@ -244,22 +260,26 @@ def map_bounded():
244260
fit_markers_to_bounds = True
245261
)
246262
return render_template('map.html', map=map)
263+
247264
```
265+
248266
![image](https://user-images.githubusercontent.com/14223309/29294483-6ac3e532-8104-11e7-988c-5c19d700fe5b.png)
249267

250268
### Run the example app
251269

252270
```bash
271+
253272
$ git clone https://github.com/rochacbruno/Flask-GoogleMaps
254273
$ cd Flask-GoogleMaps/examples
255274
$ python setup.py develop
256275
$ python example.py
276+
running..
257277

258278
```
259279

260280
Access: http://localhost:5000/ and http://localhost:5000/fullmap
261281

262-
### TODO (open a Pull Request):
282+
### TODO (open a Pull Request)
263283

264284
Implement other methods from the api, add layers etc...
265285

flask_googlemaps/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# coding: utf-8
1+
"""FlaskGoogleMaps - Google Maps Extension for Flask"""
2+
3+
__version__ = '0.2.5'
24

35
from flask import render_template, Blueprint, Markup, g
46
from flask_googlemaps.icons import dots

flit.ini

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[metadata]
2+
module = flask_googlemaps
3+
dist-name = Flask-GoogleMaps
4+
author = Bruno Rocha
5+
author-email = [email protected]
6+
maintainer = rochacbruno
7+
maintainer-email = [email protected]
8+
home-page = https://github.com/rochacbruno/Flask-GoogleMaps/
9+
requires = flask
10+
description-file = README.md
11+
classifiers = Programming Language :: Python
12+
Programming Language :: Python :: 2.7
13+
Programming Language :: Python :: 3.6
14+
Intended Audience :: Developers
15+
License :: OSI Approved :: MIT License
16+
Framework :: Flask
17+
Topic :: Internet :: WWW/HTTP :: Dynamic Content
18+
Topic :: Software Development :: Libraries :: Python Modules

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
setup(
66
name='Flask-GoogleMaps',
7-
version='0.2.4',
7+
version='0.2.5',
88
license='MIT',
99
description='Small extension for Flask to make using Google Maps easy',
1010
long_description=open('README.md').read(),

0 commit comments

Comments
 (0)