Skip to content

URL's map

gista edited this page Oct 12, 2011 · 21 revisions

1. Loading and configuring application (GET)

URL: /config

Returns:

{"location":{"lon":<float>, "lat":<float>, "zoomlevel":<number>}, "poi_types":[<string>, ...], "advertisement":{"top":{"title":<string>,"image":<string>,"url":<string>,"transparency":<float>},"side":{"title":<string>,"image":<string>,"url":<string>}},
"live_users":[{"id":<number>, "username":<string>, "first_name":<string>, "last_name":<string>, "email":<string>, "phone":<string>, 
tracks:[{"id":<number>, "name":<string>, "description":<string>, "is_active":<boolean>, "last_location_time":<string>}, ...]}, ...]}

, where:

  • live_users - live tracking field
  • location - initial location showed in the map
  • poi_types - list of POI categories in the map
  • advertisement - advertising objects for map

2. Filling all points with data in a single layer (GET)

URL: /mapdata/geojson/pois

parameters:

  • type

Returns: geojson:

id
type
geometry
properties:{"has_photo":<boolean>, "has_article":<boolean>}  

2.1 CestaSNP line (GET)

URL: /mapdata/geojson/snppath

parameters:

  • simplify
  • bbox (in format xmin,ymin,xmax,ymax)

Returns: geojson of a line

3.0 Receive message from SMSSync (POST)

URL: /live_tracking/message see: https://github.com/eyedol/smssync

parameters:

  • from
  • message
  • secret

Returns:

* *Succeeded* 
        {
            - payload: {
                success: "false"
            }
        }
  
* *Failed*
        {
            - payload: {
                success: "false"
            }
        }

3.1 Messages content (GET)

URL: /live_tracking/messages

parameters:

  • track_id

Returns:

[{"lon":<number>, "lat":<number>, "message":<string>, "time":<string>}, ...]

3.2 Inserting POI (POST)

URL: /mapdata/poi

parameters:

  • name
  • type
  • note
  • lat
  • lon
  • photos

3.3 Help (GET)

URL: /help

parameters:

  • language (accept values from {% get_current_language as LANGUAGE_CODE %} )

Returns: html page

3.4 Point data (GET)

URL: /mapdata/poidetail

parameters:

  • id

Returns:

{"area":<string>, "name":<string>, "note":<string>, 
"articles":[{"article_title":<string>, "article_introtext":<string>, "article_url":<string>}, ...],
"photos_jos":[{"photo_title":<string>, "photo_thumb_url":<string>, "photo_url":<string>}, ...],
"photos_map":[<number>, ...]}

, where:

  • photos_map - list of photo ids from map

3.5 GPX (GET)

URL: /mapdata/gpx

Returns: gpx file