From deee0476d2e5257c57f0ef1642fa379c93d8ba23 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 24 Jan 2017 23:16:25 +1300 Subject: Extract URL and token from location --- web/simple/app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'web/simple') diff --git a/web/simple/app.js b/web/simple/app.js index d622e5c..a37d9d5 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({ -- cgit v1.2.3