aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-01-24 23:16:25 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2017-01-24 23:16:25 +1300
commitdeee0476d2e5257c57f0ef1642fa379c93d8ba23 (patch)
tree19b52ebe05c5e17698e30f5b722cb6a9b55caecf
parent6171c7275a32c3ad9653aafaf673ab93254c8d1a (diff)
downloadtrackermap-web-deee0476d2e5257c57f0ef1642fa379c93d8ba23.tar.gz
trackermap-web-deee0476d2e5257c57f0ef1642fa379c93d8ba23.tar.bz2
trackermap-web-deee0476d2e5257c57f0ef1642fa379c93d8ba23.zip
Extract URL and token from location
-rw-r--r--web/simple/app.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/web/simple/app.js b/web/simple/app.js
index d622e5cc..a37d9d5c 100644
--- a/web/simple/app.js
+++ b/web/simple/app.js
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 Anton Tananaev (anton@traccar.org)
+ * Copyright 2016 - 2017 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-var url = 'http://localhost:8082';
-var token = 'TOKEN';
+var url = window.location.protocol + '//' + window.location.host;
+var token = (window.location.search.match(/token=([^&#]+)/) || [])[1];
var style = new ol.style.Style({
image: new ol.style.Circle({