SilverStripe OSM

OpenStreetmapService
in package
Uses Configurable

Table of Contents

Properties

$mapbox_url  : string
API endpoint for static maps Full URL Format: [ https URI styles v1 {@config self::config()->get('static')['style']; static latitude longitude {@config self::config()->get('static')['width'] {@config self::config()->get('static')['height'] ] get params: Environment::getEnv('MAPBOX_TOKEN');

Methods

addLocations()  : void
Put the list of locations in to the <head> element.
getMapLocation()  : mixed
getStaticMapImage()  : Image
Fetches a generated static image from Mapbox, and stores it locally to avoid potential slow responses or key exhaustion.

Properties

$mapbox_url

API endpoint for static maps Full URL Format: [ https URI styles v1 {@config self::config()->get('static')['style']; static latitude longitude {@config self::config()->get('static')['width'] {@config self::config()->get('static')['height'] ] get params: Environment::getEnv('MAPBOX_TOKEN');

protected static string $mapbox_url = 'https://api.mapbox.com/styles/v1/%s/static/%s,%s,%s,0/%sx%s?access_token=%s'

Methods

addLocations()

Put the list of locations in to the <head> element.

public addLocations(DataList|ArrayList $list) : void
Parameters
$list : DataList|ArrayList

getStaticMapImage()

Fetches a generated static image from Mapbox, and stores it locally to avoid potential slow responses or key exhaustion.

public getStaticMapImage(Location $location[, int $width = 0 ][, int $height = 0 ][, int $zoom = 0 ]) : Image
Parameters
$location : Location
$width : int = 0
$height : int = 0
$zoom : int = 0
Tags
throws
ValidationException
Return values
Image

        
On this page

Search results