SiteWatch API Examples.
Copyright © 2011 - 2023 Samsýn ehf. All Rights Reserved.

Simple map
Simple marker
Simple line
Simple circle
Simple track location
Complex marker
Map coordinate
Project coordinate
Points routing
Address search
Complex track location
Json config
Custom canvas
Id:  *
Point:  *  
Radius (optional):
Simplify (optional):
Map (This is how the map looks like based on the configuration on the left):
Code (This is how the code looks like based on the configuration above. It can be copied and pasted directly into your project):
<html> <head> <title>SiteWatch API Example Viewer</title> <script src='' type='text/javascript'></script> <script type='text/javascript'> //A map object variable. var map; //Routing result function. function rResult(map, res) { map.addVectorLine('line',[0].points, { color: 'blue', size: 3 }); }; //Create a map object. function InitMap() { map = SWMap.create('map', { panButton: false, zoomButton: false, defaultZoom: 3, defaultCenterPoint: { x: 359583, y: 406481 } }); //Create point objects. var point1 = SWPoint.create(359583, 406481); var point2 = SWPoint.create(540637, 575896); //Create a route. map.route(point1.x, point1.y, point2.x, point2.y, 50, 0, rResult, this); }; </script> </head> <body onload='InitMap()'> <div id='map' style='height:300px; width:600px;'></div> </body> </html>