Skip to main content

An easy way to generate Google Static Map URLs with Python

Project description

motionless is a Python library that takes the pain out of generating Google Static Map URLs. Three map types are supported. Each is illustrated below. For fully worked code see the examples ( http://github.com/ryancox/motionless/tree/master/examples ) directory for code that parses and visualizes both GeoRSS feeds and GPX files.

For DecoratedMaps, paths are encoded if gpolyencode is present. This is useful for keeping URLs with in the 2048 character limit imposed by the service.

CenterMap

CenterMaps show a map with no markers or paths, centered on a single location.

from motionless import CenterMap
cmap = CenterMap(address='151 third st, san francisco, ca')
print cmap.generate_url()
from motionless import CenterMap
cmap = CenterMap(lat=48.858278,lon=2.294489,maptype='satellite')
print cmap.generate_url()

VisibleMap

VisibleMaps show a map with no markers or paths, automatically sized and zoomed to make the specified locations visible.

from motionless import VisibleMap
vmap = VisibleMap(maptype='terrain')
vmap.add_address('Sugarbowl, Truckee, CA')
vmap.add_address('Tahoe City, CA')
print vmap.generate_url()

DecoratedMap

DecoratedMaps contain markers and/or paths. They are automatically sized and zoomed to make the specified elements visible.

from motionless import VisibleMap
dmap = DecoratedMap()
dmap.add_marker(AddressMarker('1 Infinite Loop, Cupertino, CA',label='A'))
dmap.add_marker(AddressMarker('1600 Amphitheatre Parkway Mountain View, CA',label='G'))
print dmap.generate_url()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

motionless-1.0.tar.gz (3.9 kB view details)

Uploaded Source

File details

Details for the file motionless-1.0.tar.gz.

File metadata

  • Download URL: motionless-1.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for motionless-1.0.tar.gz
Algorithm Hash digest
SHA256 ac8bace7815b71a03adcf90deaa5a02b3d6fce00bf9e9dd53f112c73226742b5
MD5 97c51f7563a69250628415460a50195a
BLAKE2b-256 b82e30fd4d746d28407daa2638e99ec3937fe6fcd0abf04c168bb8fcf468814c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page