Attachment 'GithubGeoJson.py'

Download

   1 # -*- coding: utf-8 -*-
   2 #Author: Igor Támara igor@tamarapatino.org
   3 #Date: 01/07/2013
   4 #No warranties.
   5 """
   6   MoinMoin - Geo Json github
   7   Embeds a geojson map from github inside moinmoin
   8 
   9   Inputs: Receieves a Github URL containing a geojson file, it must be
  10   of the kind embed
  11 
  12   For instance:
  13   <<GithubGeoJson(https://embed.github.com/view/geojson/ikks/moinmoin-github-osm/master/samples/colombiatermal.geojson)>>
  14 
  15   would show a nice map with openstreetmap as it base layers and all
  16   the geometries in a nice leaflet container by github and mapbox.
  17 
  18   For instructions on how to build the URL for embedding, take a look at
  19   https://help.github.com/articles/mapping-geojson-files-on-github
  20 """
  21 
  22 
  23 def execute(macro, args):
  24     if not args.startswith('https://embed.github.com/view/geojson/'):
  25         return "you must offer something that starts with https://embed.github..."
  26     return macro.formatter.rawHTML('<script src="{0}"></script>'.format(args))

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2013-07-12 04:28:10, 0.9 KB) [[attachment:GithubGeoJson.py]]
  • [get | view] (2014-09-14 14:59:05, 107.3 KB) [[attachment:mapsample.png]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.