Welcome to Steerpath Web SDK documentation. Here you can find how to make the best use of our extension to Mapbox GL JS library. To start building your own web applications and websites showcasing your building please contact http://www.steerpath.com/
Current version: steerpath-3.1.5.js
Quickstart
To get started with Steerpath Maps in your web application check out this example map of our office.
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>Steerpath Example</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.42.1/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.42.1/mapbox-gl.css' rel='stylesheet' />
<script src="https://s3-eu-west-1.amazonaws.com/steerpath-web-sdk/v3.1.5/steerpath-3.1.5.min.js"></script>
<style>
body { margin:0; padding:0; }
#mapboxMap { position:absolute; width:100%; height: 100%}
</style>
</head>
<body>
<div id='mapboxMap'></div>
<script>
//initialise Mapbox
mapboxgl.accessToken = '';
var token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZXMiOiJiYXNlOnI7c3RlZXJwYXRoX3N0YXRpYzpyO3N0ZWVycGF0aF9keW5hbWljOnIiLCJtZXRhQWNjZXNzIjoieSIsImp0aSI6IjhlNTA2OWRhLTViNDEtNGYxZS1iYjYzLTE3NmE0Y2FjMDcyOCIsInN1YiI6InN0ZWVycGF0aCIsImVkaXRSaWdodHMiOiIiLCJlaWRBY2Nlc3MiOiJ5In0.in8zIUm_ZlVhmYPhRMsMxShlqCH0nJnof0kRlWyKuQw";
var styleUrl = "https://mapdata.eu.steerpath.com/style/web.json?access_token="+token
var mapboxMap = new mapboxgl.Map({
container: 'mapboxMap',
style: styleUrl,
center: [24.81249496, 60.22095443],
zoom: 18,
bearing: 0,
pitch: 0
});
//options for SteerpathMap class
var options = {
inspectionZoomLevel: 15,
inspectionBoundaries: 0.5,
queryOnceMapLoad: true
};
//create instance of SteerpathMap
var steerpathMap = new steerpath.SteerpathMap(mapboxMap, options);
//create floor switcher control and add it to the map
var floorSwitcher = new steerpath.FloorSwitcherControl(steerpathMap);
mapboxMap.addControl(floorSwitcher, 'bottom-right');
</script>
</body>
</html>
Change log
Version number (3.1.5 - 27.11.2017)
New Features
- New routing algorithm
Bug Fixes
- Fixed a bug in routing engine.
- Check if tiles are loaded before hiding a bulding
Version number (3.1.4 - 23.11.2017)
Bug Fixes
- Fixed a bug in routing engine.
Version number (3.1.3 - 22.11.2017)
Bug Fixes
- RouteManager removes duplicate coordinates when route is set.
Version number (3.1.2 - 21.11.2017)
Breaking changes
- directionsApi.solveAll() changed to directionsApi.solveAlternatives(numberOfAlternatives)
New Features
- Route engine's directionsApi can return alternative routes for RouteManager to show
- RouteManager.initRouteManager(routes) will handle the initialisation of route visualisation. If RouteManager was given numberOfAlternatives option it will show all the alternatives given in initRouteManager method. If there's no alternative routes initRouteManager will visualise default route.
- New options for RouteManager regarding alternative routes: altRouteLineColor and numberOfAlternatives
Bug Fixes
- Sometimes when zooming or panning aggressively tiles were not yet loaded on moveend event. This caused buildings to disappear from the view since queryRenderedFeatures couldn't find Steerpath building data. Now SteerpathMap waits for tiles to load and retries to find building data. If building data is not found then hideActiveBuilding() will be called.
Version number (3.1.1 - 20.11.2017)
Bug Fixes
- Fixed a bug in route engine
Version number (3.1.0-beta - 30.10.2017)
New Features
- Visualise alternative routes with RouteManager.
Bug Fixes
- Fixed a bug in SteerpathMap when querying map view for building data.
- Check that building_outline layer exists
Version number (3.0.2-beta - 15.9.2017)
Bug Fixes
- Fixed a bug in building query which caused issues with IE11
Version number (3.0.1) - 18.7.2017
New features
- steerpath.SteerpathMap.queryForSteerpathBuilding(analyseQueriedView) optional boolean parameter analyseQueriedView which sets whether or not the view will be updated if there was a steerpath building in the view.
- steerpath.SteerpathMap.queryInFixedPosition(point, analyseQueriedView) method to query the map in certain x,y-point and update the view if there was a steerpath building in the position.
- steerpath.RouteAnimationManager optional boolean option showRoutePreview. Which will trigger an animation to show first fit the map view to route's bounds and then fly to a starting point.
- steerpath.RouteAnimationManager new optional option slowSpeedOnTurns which slows down animation to third of the animationSpeed by default. Can be changed from RouteAnimationManager instance.
Bug fixes
- Simplified route points in RouteAnimationManager.
- Route animation performance improvement. Update the map center when bluedot source data is updated on('sourcedata')-event. This will also reduce the flickering with the bluedot.
Version number (3.0.0) - 30.6.2017
New features
- steerpath.SteerpathMap.queryForSteerpathBuilding() which gets called on map.moveend and map.onload but it can now be called programmatically. It queries map view for Steerpath buildings and update the view accordingly. It returns the building in the view.
- Showcase
- RouteManager
- RouteAnimationManager
Version number (3.0.0-beta) - 23.6.2017
Breaking changes
- Changed steerpath.SteerpathAPI into steerpath.SteerpathMap
- Changed steerparth.steerpathMarker into steerpath.Marker
- Changed steerpath.SteerpathFloorSwitcherControl into steerpath.FloorSwitcherControl
- Changed steerpath.SteerpathAPI.latestVisibleBuilding into steerpath.SteerpathMap.latestActiveBuilding
New features
- in SteerpathMap added option filterPrefix true/false which will enable API to be compatible with Mapbox GL Draw.
- in SteerpathMap new methods: setInspectionZoomLevel, setInspectionBoundaries, setQueryOnceMapLoad, setShowFloorsWithSameIndex
- in FloorSwitcherControl methods hide- and showFloorSwitcher() don't require parameter floorLists anymore.
Bug fixes
- Fixed bug in floor switcher when changing floor programmatically
- Fixed bug in changeLayerIndex() method