This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Static maps

Get a PNG image map including markers, shapes and labels.

    Web services

    Static maps API documentation, available via HTTP-JSON/XML service.

    URL base service:

    • HTTP requests in POST
    • Response in JSON / XML format

    You can get a static map using a image path, ore directly a bit array.

    The maximum image size is &width=1680&height=1280. This size is in pixels.

    Paint markers in the map

    Request

    Example:

    https://lb.cercalia.com/services/xmlgeo?cmd=map&ctn=girona&ctryc=ESP&key=YOUR_API_KEY
    

    Where:

    ParameterDescription
    cmdmap fixed parameter (request type = static map)
    width & heightImage size (in pixels)
    mocsgdd coordinate system (gdd -> geographical lat,long). Optional
    extentY,X upper left
    molistList of markers. Format: `[Y,X

    *Icons: the icon is specified by an integer numeric code (1,2,3 …). These icons must be published on the Cercalia platform servers.

    Optional:

    ParameterDescription
    imgReturns the image, instead of a JSON / XML

    Response

    If request includes &img= paramether, the response is the image (array of bits).

    Otherwise, the response is in JSON/XML format, including the path for dowloading the image:

    {
        "cercalia": {
            "cmd": "map",
            "version": "1",
            "proximity": {
                "center": "2.82360257,41.98164077",
                "num": "1",
                "op": "3"
            },
            "map": {
                "cmode": "rf",
                "smap": "0",
                "style": "default",
                "img": {
                    "center": "2.82360257,41.98164077",
                    "format": "gif",
                    "height": "250",
                    "href": "/MapesNG/Cercalia/map/map0/45891615731.gif",
                    "scale": "4",
                    "width": "350",
                    "extent": {
                        "coord": [
                            {
                                "x": "2.79240408",
                                "y": "41.99826097"
                            },
                            {
                                "x": "2.85479207",
                                "y": "41.96501619"
                            }
                        ]
                    }
                },
                "label": {
                    "op": "1",
                    "pt": "2.82360257,41.98164077",
                    "$valor": "Girona"
                },
                "poicats": {},
                "shapes": {}
            },
            "server": {
                "$valor": "lb.cercalia.com"
            },
            "instance": {
                "$valor": "http://cercalia-lbs-both-lines"
            }
        }
    }
    

    Where:

    ParameterDescription
    href/MapesNG/Cercalia/map/map0/45891615731.gif Image path
    https://lb.cercalia.comServer
    Path including server + imagehttps://lb.cercalia.com/MapesNG/Cercalia/map/map0/45891615731.gif

    Map example:

    Marker pintado en mapa

    Paint polylines, areas and labels

    Request

    Example:

    https://lb.cercalia.com/services/json?cmd=map&width=400&height=300&labelop=0&mocs=gdd&cs=gdd&extent=41.439132726,2.003108336|41.390497829,2.197135455&shape=[255,0,0,128|2|0,255,0,128|CIRCLE|41.439132726,2.003108336|2000],[255,0,0|2|255,0,0|POLYLINE|41.401902461,2.142455003|41.404628181,2.155965665|41.433339308,2.179860852]&key=YOUR_API_KEY
    

    Where &shape= paramether include several type of shapes: circle, rectangle, sector, line, polyline, label

    Shape format:

    [outline color | outline size | fill color | shape type | specific paramethers]

    ParameterDescription
    outline colorRGBA* format.
    outline sizeIn pixels.
    fill colorRGBA* format.
    shape typeshape.
    specific parametersSpecific parameters according to every type of shape.

    * RGBA format (red,green,blue,alpha):

    ParameterDescription
    Red[value between 0-255]
    Green[value between 0-255]
    Blue[value between 0-255]
    AlphaTransparency [value between 0 (transparent) – 255 (opaque)]. Default value: 255.

    Example:

    https://lb.cercalia.com/services/json?cmd=map&ctn=Girona&shape=[255,0,0|3|0,255,0,128|RECTANGLE|316502,5132529|314502,5130528],[255,0,0,128|10|0,255,0,128|CIRCLE|314502,5130528|1000]&key=YOUR_API_KEY
    

    **Shape types and specific paramethers:

    CIRCLE

    Draw a circle. Specific paramethers:

    ParameterDescription
    centerY,X coordinate
    radiusRadius, in meters

    RECTANGLE

    Draw a rectagle. Specific paramethers:

    upper left coordinates | lower right coordinates

    SECTOR

    Draw a sector. Specific paramethers:

    center | internal radius | external radius | start angle | end angle

    ParameterDescription
    centerY,X coordinate
    internal radiusRadius, in meters, where the sector starts
    radio externoRadius, in meters, where the sector ends
    start angleAngle, in degrees, where the sector begins
    ángulo finAngle, in degrees, where the sector ends

    LINE

    Draw a line. Fill color not available. Specific paramethers:

    start coordinate | end coordinate

    POLYLINE

    Draw a polyline. Fill color not available. Specific paramethers:

    coordinate 1 | coordinate 2 | .... | coordinate n

    LABEL

    Draw a label starting in a coordinate. Specific paramethers:

    center | text

    ParameterDescription
    centerCoordinates, text starting point
    textLabel content

    Example:

    Liniea y circulo pintado en mapa