Commit c8897ff3 authored by Patrick's avatar Patrick
Browse files

update here test

parent bf137ad8
Showing with 1413 additions and 11 deletions
+1413 -11
node_modules node_modules
node_modules
codepoly.js 0 → 100644
/*
* Copyright (C) 2019 HERE Europe B.V.
* Licensed under MIT, see full license in LICENSE
* SPDX-License-Identifier: MIT
* License-Filename: LICENSE
*/
const DEFAULT_PRECISION = 5;
const ENCODING_TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
const DECODING_TABLE = [
62, -1, -1, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
22, 23, 24, 25, -1, -1, -1, -1, 63, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51
];
const FORMAT_VERSION = 1;
const ABSENT = 0;
const LEVEL = 1;
const ALTITUDE = 2;
const ELEVATION = 3;
// Reserved values 4 and 5 should not be selectable
const CUSTOM1 = 6;
const CUSTOM2 = 7;
const Num = typeof BigInt !== "undefined" ? BigInt : Number;
function decode(encoded) {
const decoder = decodeUnsignedValues(encoded);
const header = decodeHeader(decoder[0], decoder[1]);
const factorDegree = 10 ** header.precision;
const factorZ = 10 ** header.thirdDimPrecision;
const { thirdDim } = header;
let lastLat = 0;
let lastLng = 0;
let lastZ = 0;
const res = [];
let i = 2;
for (;i < decoder.length;) {
const deltaLat = toSigned(decoder[i]) / factorDegree;
const deltaLng = toSigned(decoder[i + 1]) / factorDegree;
lastLat += deltaLat;
lastLng += deltaLng;
if (thirdDim) {
const deltaZ = toSigned(decoder[i + 2]) / factorZ;
lastZ += deltaZ;
res.push([lastLat, lastLng, lastZ]);
i += 3;
} else {
res.push([lastLat, lastLng]);
i += 2;
}
}
if (i !== decoder.length) {
throw new Error('Invalid encoding. Premature ending reached');
}
return {
...header,
polyline: res,
};
}
function decodeChar(char) {
const charCode = char.charCodeAt(0);
return DECODING_TABLE[charCode - 45];
}
function decodeUnsignedValues(encoded) {
let result = Num(0);
let shift = Num(0);
const resList = [];
encoded.split('').forEach((char) => {
const value = Num(decodeChar(char));
result |= (value & Num(0x1F)) << shift;
if ((value & Num(0x20)) === Num(0)) {
resList.push(result);
result = Num(0);
shift = Num(0);
} else {
shift += Num(5);
}
});
if (shift > 0) {
throw new Error('Invalid encoding');
}
return resList;
}
function decodeHeader(version, encodedHeader) {
if (+version.toString() !== FORMAT_VERSION) {
throw new Error('Invalid format version');
}
const headerNumber = +encodedHeader.toString();
const precision = headerNumber & 15;
const thirdDim = (headerNumber >> 4) & 7;
const thirdDimPrecision = (headerNumber >> 7) & 15;
return { precision, thirdDim, thirdDimPrecision };
}
function toSigned(val) {
// Decode the sign from an unsigned value
let res = val;
if (res & Num(1)) {
res = ~res;
}
res >>= Num(1);
return +res.toString();
}
function encode({ precision = DEFAULT_PRECISION, thirdDim = ABSENT, thirdDimPrecision = 0, polyline }) {
// Encode a sequence of lat,lng or lat,lng(,{third_dim}). Note that values should be of type BigNumber
// `precision`: how many decimal digits of precision to store the latitude and longitude.
// `third_dim`: type of the third dimension if present in the input.
// `third_dim_precision`: how many decimal digits of precision to store the third dimension.
const multiplierDegree = 10 ** precision;
const multiplierZ = 10 ** thirdDimPrecision;
const encodedHeaderList = encodeHeader(precision, thirdDim, thirdDimPrecision);
const encodedCoords = [];
let lastLat = Num(0);
let lastLng = Num(0);
let lastZ = Num(0);
polyline.forEach((location) => {
const lat = Num(Math.round(location[0] * multiplierDegree));
encodedCoords.push(encodeScaledValue(lat - lastLat));
lastLat = lat;
const lng = Num(Math.round(location[1] * multiplierDegree));
encodedCoords.push(encodeScaledValue(lng - lastLng));
lastLng = lng;
if (thirdDim) {
const z = Num(Math.round(location[2] * multiplierZ));
encodedCoords.push(encodeScaledValue(z - lastZ));
lastZ = z;
}
});
return [...encodedHeaderList, ...encodedCoords].join('');
}
function encodeHeader(precision, thirdDim, thirdDimPrecision) {
// Encode the `precision`, `third_dim` and `third_dim_precision` into one encoded char
if (precision < 0 || precision > 15) {
throw new Error('precision out of range. Should be between 0 and 15');
}
if (thirdDimPrecision < 0 || thirdDimPrecision > 15) {
throw new Error('thirdDimPrecision out of range. Should be between 0 and 15');
}
if (thirdDim < 0 || thirdDim > 7 || thirdDim === 4 || thirdDim === 5) {
throw new Error('thirdDim should be between 0, 1, 2, 3, 6 or 7');
}
const res = (thirdDimPrecision << 7) | (thirdDim << 4) | precision;
return encodeUnsignedNumber(FORMAT_VERSION) + encodeUnsignedNumber(res);
}
function encodeUnsignedNumber(val) {
// Uses variable integer encoding to encode an unsigned integer. Returns the encoded string.
let res = '';
let numVal = Num(val);
while (numVal > 0x1F) {
const pos = (numVal & Num(0x1F)) | Num(0x20);
res += ENCODING_TABLE[pos];
numVal >>= Num(5);
}
return res + ENCODING_TABLE[numVal];
}
function encodeScaledValue(value) {
// Transform a integer `value` into a variable length sequence of characters.
// `appender` is a callable where the produced chars will land to
let numVal = Num(value);
const negative = numVal < 0;
numVal <<= Num(1);
if (negative) {
numVal = ~numVal;
}
return encodeUnsignedNumber(numVal);
}
module.exports = {
encode,
decode,
ABSENT,
LEVEL,
ALTITUDE,
ELEVATION,
};
This diff is collapsed.
...@@ -232,6 +232,20 @@ ...@@ -232,6 +232,20 @@
</div> </div>
<a href="#" onclick="drawFlow();" >Verkehrsflow</a> <a href="#" onclick="drawFlow();" >Verkehrsflow</a>
</div> </div>
<button class="accordion">Navigation</button>
<div class="sub-menu">
<a href="#" onclick="Navigationshow();getPosition();" >Car</a>
<div class="switch-toggle switch-3 switch-candy">
<input id="acc-on" name="state-d" type="radio" checked="" />
<label for="on" onclick="drawnavcar()">ON</label>
<input id="acc-off" name="state-d" type="radio" checked="true"/>
<label for="na" onclick="">OFF</label><br><br>
</div><br>
</div>
</div> </div>
</div> </div>
<!-- Drop down menu ends here --> <!-- Drop down menu ends here -->
...@@ -248,6 +262,7 @@ ...@@ -248,6 +262,7 @@
</h1> </h1>
<button id="tourstart-btn" onclick="stopStory(); removebuildings();getTraffic();getFlow();getFlowtest();" class="buttonset one"><span class="i18n_balloon_startscreen_btn">Start</span> <button id="tourstart-btn" onclick="stopStory(); removebuildings();getTraffic();getFlow();getFlowtest();" class="buttonset one"><span class="i18n_balloon_startscreen_btn">Start</span>
</button> </button>
<!-- getNAVcar(); -->
</div> </div>
<div class="dialog-image-balloon"></div> <div class="dialog-image-balloon"></div>
<div class="balloon-left-edge"></div> <div class="balloon-left-edge"></div>
...@@ -609,7 +624,21 @@ ...@@ -609,7 +624,21 @@
<div style='width:100%;margin-top:200px;' id="chartNordB"></div> <div style='width:100%;margin-top:200px;' id="chartNordB"></div>
<!-- <div id="slider-color"></div> --> <!-- <div id="slider-color"></div> -->
</div> </div>
<div id="Navigation" class="SideInfo" style="display:none;">
<h1 class="sticky" id="headNordB">Navigationsberechner</h1>
<p class="contentOne">Bitte wählen Sie einen Start und Endpunkt für ihre Route aus.</p>
<button onclick="getStart('Start');">Startpunkt</button>
<input type="text" id="Spunktlat" name="Spunktlat">
<input type="text" id="Spunktlon" name="Spunktlon"><br><br>
<button onclick="getStart('End');">Endpunkt</button>
<input type="text" id="Epunktlat" name="Epunktlat">
<input type="text" id="Epunktlon" name="Epunktlon"><br><br>
<button onclick="showRoute();">Route berechnen</button>
<button onclick="drawnavcar();">Route anzeigen</button>
<input type="text" id="Routeduration" name="Duration">
</div>
</div> </div>
<div id="tour-button" title="Karte/Story umschalten"> <div id="tour-button" title="Karte/Story umschalten">
<i class="fa"></i> <i class="fa"></i>
...@@ -631,6 +660,8 @@ ...@@ -631,6 +660,8 @@
<script src="sources/nouislider.js"></script> <script src="sources/nouislider.js"></script>
<script src="https://cdn.jsdelivr.net/npm/apexcharts"></script> <script src="https://cdn.jsdelivr.net/npm/apexcharts"></script>
<script src="templates/slider.js"></script> <script src="templates/slider.js"></script>
<script src="templates/UserBalloon.js"></script>
<script src="js/navigation.js"></script>
<link href="templates/sliders.css" rel="stylesheet"> <link href="templates/sliders.css" rel="stylesheet">
<script> <script>
...@@ -651,6 +682,7 @@ ...@@ -651,6 +682,7 @@
<script src='lib/vcm_ui.js'></script> <script src='lib/vcm_ui.js'></script>
<script src="js/here.js"></script> <script src="js/here.js"></script>
<script src="js/codepoly.js"></script>
<script src="templates/custom.js"></script> <script src="templates/custom.js"></script>
<script src="templates/newDevBahn.js"></script> <script src="templates/newDevBahn.js"></script>
<script src="templates/cus_Menu.js"></script> <script src="templates/cus_Menu.js"></script>
......
/*
* Copyright (C) 2019 HERE Europe B.V.
* Licensed under MIT, see full license in LICENSE
* SPDX-License-Identifier: MIT
* License-Filename: LICENSE
*/
const DEFAULT_PRECISION = 5;
const ENCODING_TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
const DECODING_TABLE = [
62, -1, -1, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
22, 23, 24, 25, -1, -1, -1, -1, 63, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51
];
const FORMAT_VERSION = 1;
const ABSENT = 0;
const LEVEL = 1;
const ALTITUDE = 2;
const ELEVATION = 3;
// Reserved values 4 and 5 should not be selectable
const CUSTOM1 = 6;
const CUSTOM2 = 7;
const Num = typeof BigInt !== "undefined" ? BigInt : Number;
function decode(encoded) {
const decoder = decodeUnsignedValues(encoded);
const header = decodeHeader(decoder[0], decoder[1]);
const factorDegree = 10 ** header.precision;
const factorZ = 10 ** header.thirdDimPrecision;
const { thirdDim } = header;
let lastLat = 0;
let lastLng = 0;
let lastZ = 0;
const res = [];
let i = 2;
for (;i < decoder.length;) {
const deltaLat = toSigned(decoder[i]) / factorDegree;
const deltaLng = toSigned(decoder[i + 1]) / factorDegree;
lastLat += deltaLat;
lastLng += deltaLng;
if (thirdDim) {
const deltaZ = toSigned(decoder[i + 2]) / factorZ;
lastZ += deltaZ;
res.push([lastLat, lastLng, lastZ]);
i += 3;
} else {
res.push([lastLat, lastLng]);
i += 2;
}
}
if (i !== decoder.length) {
throw new Error('Invalid encoding. Premature ending reached');
}
return {
...header,
polyline: res,
};
}
function decodeChar(char) {
const charCode = char.charCodeAt(0);
return DECODING_TABLE[charCode - 45];
}
function decodeUnsignedValues(encoded) {
let result = Num(0);
let shift = Num(0);
const resList = [];
encoded.split('').forEach((char) => {
const value = Num(decodeChar(char));
result |= (value & Num(0x1F)) << shift;
if ((value & Num(0x20)) === Num(0)) {
resList.push(result);
result = Num(0);
shift = Num(0);
} else {
shift += Num(5);
}
});
if (shift > 0) {
throw new Error('Invalid encoding');
}
return resList;
}
function decodeHeader(version, encodedHeader) {
if (+version.toString() !== FORMAT_VERSION) {
throw new Error('Invalid format version');
}
const headerNumber = +encodedHeader.toString();
const precision = headerNumber & 15;
const thirdDim = (headerNumber >> 4) & 7;
const thirdDimPrecision = (headerNumber >> 7) & 15;
return { precision, thirdDim, thirdDimPrecision };
}
function toSigned(val) {
// Decode the sign from an unsigned value
let res = val;
if (res & Num(1)) {
res = ~res;
}
res >>= Num(1);
return +res.toString();
}
function encode({ precision = DEFAULT_PRECISION, thirdDim = ABSENT, thirdDimPrecision = 0, polyline }) {
// Encode a sequence of lat,lng or lat,lng(,{third_dim}). Note that values should be of type BigNumber
// `precision`: how many decimal digits of precision to store the latitude and longitude.
// `third_dim`: type of the third dimension if present in the input.
// `third_dim_precision`: how many decimal digits of precision to store the third dimension.
const multiplierDegree = 10 ** precision;
const multiplierZ = 10 ** thirdDimPrecision;
const encodedHeaderList = encodeHeader(precision, thirdDim, thirdDimPrecision);
const encodedCoords = [];
let lastLat = Num(0);
let lastLng = Num(0);
let lastZ = Num(0);
polyline.forEach((location) => {
const lat = Num(Math.round(location[0] * multiplierDegree));
encodedCoords.push(encodeScaledValue(lat - lastLat));
lastLat = lat;
const lng = Num(Math.round(location[1] * multiplierDegree));
encodedCoords.push(encodeScaledValue(lng - lastLng));
lastLng = lng;
if (thirdDim) {
const z = Num(Math.round(location[2] * multiplierZ));
encodedCoords.push(encodeScaledValue(z - lastZ));
lastZ = z;
}
});
return [...encodedHeaderList, ...encodedCoords].join('');
}
function encodeHeader(precision, thirdDim, thirdDimPrecision) {
// Encode the `precision`, `third_dim` and `third_dim_precision` into one encoded char
if (precision < 0 || precision > 15) {
throw new Error('precision out of range. Should be between 0 and 15');
}
if (thirdDimPrecision < 0 || thirdDimPrecision > 15) {
throw new Error('thirdDimPrecision out of range. Should be between 0 and 15');
}
if (thirdDim < 0 || thirdDim > 7 || thirdDim === 4 || thirdDim === 5) {
throw new Error('thirdDim should be between 0, 1, 2, 3, 6 or 7');
}
const res = (thirdDimPrecision << 7) | (thirdDim << 4) | precision;
return encodeUnsignedNumber(FORMAT_VERSION) + encodeUnsignedNumber(res);
}
function encodeUnsignedNumber(val) {
// Uses variable integer encoding to encode an unsigned integer. Returns the encoded string.
let res = '';
let numVal = Num(val);
while (numVal > 0x1F) {
const pos = (numVal & Num(0x1F)) | Num(0x20);
res += ENCODING_TABLE[pos];
numVal >>= Num(5);
}
return res + ENCODING_TABLE[numVal];
}
function encodeScaledValue(value) {
// Transform a integer `value` into a variable length sequence of characters.
// `appender` is a callable where the produced chars will land to
let numVal = Num(value);
const negative = numVal < 0;
numVal <<= Num(1);
if (negative) {
numVal = ~numVal;
}
return encodeUnsignedNumber(numVal);
}
// module.exports = {
// encode,
// decode,
// ABSENT,
// LEVEL,
// ALTITUDE,
// ELEVATION,
// };
var traffic; var traffic;
var flow; var flow;
var navcar;
var navcardata;
var geojson; var geojson;
var geolat; var geolat;
var geolong; var geolong;
var originalJson; var originalJson;
var pol;
function getNAVcar(){
// var incidents = getTraffic()
try {
$.ajax({
type: "POST",
url: '/NavCARdata',
}).done(function (newdata) {
convertdata(newdata);
});
function convertdata(data) {
navcardata = data;
console.log(navcardata)
}
return navcardata
}
catch (err) {
console.log('loading Gas Values from DB failed!');
}
// pol = decode(navcar.body.routes[0].sections[0].polyline)
// geolat = traffic.body.TRAFFIC_ITEMS.TRAFFIC_ITEM[0].LOCATION.GEOLOC.ORIGIN.LATITUDE;
// geolong = traffic.body.TRAFFIC_ITEMS.TRAFFIC_ITEM[0].LOCATION.GEOLOC.ORIGIN.LONGITUDE;
// var type = traffic.body.TRAFFIC_ITEMS.TRAFFIC_ITEM[0].TRAFFIC_ITEM_DESCRIPTION[0].value;
// roadclose = new vcs.vcm.layer.GeoJSON({
// name: "ROAD_CLOSURE",
// url: "http://localhost:8083/CONSTRUCTION",
// data: geojson,
// projection: {
// epsg: 4326
// },
// altitudeMode : "relativeToGround",
// style: {
// image: {
// icon: {
// src: "./img/traffic/icons8-straßensperre-64.png",
// scale: 1
// }
// }
// },
// heightAboveGround: 0
// })
// framework.addLayer(roadclose)
// roadclose.activate(true);
};
function getAccidents(type){ function getAccidents(type){
// var incidents = getTraffic() // var incidents = getTraffic()
console.log(traffic); console.log(traffic);
...@@ -106,6 +155,30 @@ catch (err) { ...@@ -106,6 +155,30 @@ catch (err) {
console.log('loading Gas Values from DB failed!'); console.log('loading Gas Values from DB failed!');
} }
};
function getNAV(){
// var incidents = getTraffic()
// geolat = traffic.body.TRAFFIC_ITEMS.TRAFFIC_ITEM[0].LOCATION.GEOLOC.ORIGIN.LATITUDE;
// geolong = traffic.body.TRAFFIC_ITEMS.TRAFFIC_ITEM[0].LOCATION.GEOLOC.ORIGIN.LONGITUDE;
// var type = traffic.body.TRAFFIC_ITEMS.TRAFFIC_ITEM[0].TRAFFIC_ITEM_DESCRIPTION[0].value;
try {
$.ajax({
type: "POST",
url: '/NavCARdata',
}).done(function (newdata) {
convertdata(newdata);
});
function convertdata(data) {
navcar = data;
console.log(navcar)
}
return navcar
}
catch (err) {
console.log('loading Gas Values from DB failed!');
}
}; };
function getFlowtest(){ function getFlowtest(){
// var incidents = getTraffic() // var incidents = getTraffic()
...@@ -145,7 +218,30 @@ function drawFlow(){ ...@@ -145,7 +218,30 @@ function drawFlow(){
framework.addLayer(flowlayer) framework.addLayer(flowlayer)
flowlayer.activate(true); flowlayer.activate(true);
} }
function drawnavcar(){
var layern = ["NAVCAR"]
var layers = framework.getLayers();
for (var i = 0; i< layers.length; i++) {
var layer = layers[i];
if(layern.indexOf(layer.name) >= 0){
layer.activate(false);
}
}
framework.removeLayerByName("NAVCAR")
navcarlayer = new vcs.vcm.layer.GeoJSON({
name: "NAVCAR",
url: "http://localhost:8083/NAVCAR",
data: geojson,
projection: {
epsg: 4326
},
altitudeMode : "relativeToGround",
heightAboveGround: 0
})
framework.addLayer(navcarlayer)
navcarlayer.activate(true);
}
function getTraffic() { function getTraffic() {
try { try {
$.ajax({ $.ajax({
......
function getStart(point){
pointsoe = point;
}
var pointsoe ="";
function PostNavPoint(testing){
try {
$.ajax({
async: true,
type: "POST",
url: '/navPoint',
data: point
}).done(function (SimSMid) {
console.log(SimSMid)
convertdata();
return(SimSMid)
});
function convertdata() {
console.log("angekommen......")
if (testing == "Start"){
showStartPoint();
} else if (testing == "End"){
showEndPoint();
}
}
// // console.log(currentwind);
// return SimSOutput;
}
catch (err) {
console.log('-> function PostUserInput() failed!\n' + err);
}
}
function showStartPoint(){
var layern = ["Startpoint"]
var layers = framework.getLayers();
for (var i = 0; i< layers.length; i++) {
var layer = layers[i];
if(layern.indexOf(layer.name) >= 0){
layer.activate(false);
}
}
framework.removeLayerByName("Startpoint")
console.log("testStartpointvis")
Startpointlayer = new vcs.vcm.layer.GeoJSON({
name: "Startpoint",
url: "http://localhost:8083/Startpoint",
data: geojson,
projection: {
epsg: 4326
},
altitudeMode : "relativeToGround",
style: {
image: {
icon: {
src: "./templates/locationSM.png",
scale: 0.5
}
}
},
heightAboveGround: 0
})
framework.addLayer(Startpointlayer)
Startpointlayer.activate(true);
}
function showEndPoint(){
var layern = ["EndpointNav"]
var layers = framework.getLayers();
for (var i = 0; i< layers.length; i++) {
var layer = layers[i];
if(layern.indexOf(layer.name) >= 0){
layer.activate(false);
}
}framework.removeLayerByName("EndpointNav")
// console.log("testStartpointvis")
Endpointlayer = new vcs.vcm.layer.GeoJSON({
name: "EndpointNav",
url: "http://localhost:8083/Endpoint",
data: geojson,
projection: {
epsg: 4326
},
altitudeMode : "relativeToGround",
style: {
image: {
icon: {
src: "./templates/locationSM.png",
scale: 0.5
}
}
},
heightAboveGround: 0
})
framework.addLayer(Endpointlayer)
Endpointlayer.activate(true);
}
function showRoute(){
var datapointSend = {
slat:"",
slon:"",
sloc:"",
elat: "",
elon: "",
eloc: ""
}
datapointSend.slat = document.getElementById("Spunktlat").value;
datapointSend.slon = document.getElementById("Spunktlon").value;
datapointSend.elat = document.getElementById("Epunktlat").value;
datapointSend.elon = document.getElementById("Epunktlon").value;
try {
$.ajax({
async: true,
type: "POST",
url: '/Routecalc',
data: datapointSend
}).done(function (SimSMid) {
console.log(SimSMid)
convertdata(SimSMid);
return(SimSMid)
});
function convertdata(data) {
console.log("angekommen......")
document.getElementById("Routeduration").value = data.features[0].properties.minutesDifference + " min " + data.features[0].properties.secondsDifference + " sek";
if (testing == "Start"){
// showStartPoint();
} else if (testing == "End"){
// showEndPoint();
}
// drawnavcar();
}
// // console.log(currentwind);
// return SimSOutput;
}
catch (err) {
console.log('-> function PostUserInput() failed!\n' + err);
}
try {
$.ajax({
async: true,
type: "POST",
url: '/navPublicT',
data: datapointSend
}).done(function (SimSMid) {
console.log(SimSMid)
// convertdata();
return(SimSMid)
});
function convertdata() {
console.log("angekommen......")
if (testing == "Start"){
showStartPoint();
} else if (testing == "End"){
showEndPoint();
}
}
// // console.log(currentwind);
// return SimSOutput;
}
catch (err) {
console.log('-> function PostUserInput() failed!\n' + err);
}
}
function publictransport(){
var datapointSend = {
slat:"",
slon:"",
sloc:"",
elat: "",
elon: "",
eloc: ""
}
datapointSend.slat = document.getElementById("Spunktlat").value;
datapointSend.slon = document.getElementById("Spunktlon").value;
datapointSend.elat = document.getElementById("Epunktlat").value;
datapointSend.elon = document.getElementById("Epunktlon").value;
console.log(datapointSend);
try {
$.ajax({
async: true,
type: "get",
url: '/navPublicT',
data: datapointSend
}).done(function (SimSMid) {
console.log(SimSMid)
// convertdata();
return(SimSMid)
});
function convertdata() {
console.log("angekommen......")
if (testing == "Start"){
showStartPoint();
} else if (testing == "End"){
showEndPoint();
}
}
// // console.log(currentwind);
// return SimSOutput;
}
catch (err) {
console.log('-> function PostUserInput() failed!\n' + err);
}
};
\ No newline at end of file
var ballonContent = {
header: "Test",
Content: "This is a test",
lat: "",
lon: "",
categorie: ""
}
var point = {
lat:"",
lon:"",
loc:""
}
// var Startlat
// var Startlon
// var Endlat
// var Endlon
// var pointsoe
function getPosition() {
var map = vcs.vcm.Framework.getInstance().getActiveMap();
var CViewer = map.viewer
var CScene = map.viewer.scene
if (document.getElementById("Navigation").style.display == "block"){
// Mouse over the globe to see the cartographic position
handler = new Cesium.ScreenSpaceEventHandler(CScene.canvas);
handler.setInputAction(function (movement) {
var cartesian = CViewer.camera.pickEllipsoid(
movement.position,
CScene.globe.ellipsoid
);
if (cartesian) {
console.log(cartesian)
var cartographic = Cesium.Cartographic.fromCartesian(cartesian);
// var geographic = Cesium.geographic.fromCartesion(cartesian);
console.log(cartographic)
var longitudeString = Cesium.Math.toDegrees(
cartographic.longitude
);
ballonContent.lon = longitudeString;
var latitudeString = Cesium.Math.toDegrees(
cartographic.latitude
);
ballonContent.lat = latitudeString;
// alert( "Lon: " + longitudeString +
// "\u00B0" +
// "\nLat: " +
// (" " + latitudeString).slice(-7) +
// "\u00B0");
// PostUserInput();
if (pointsoe == "Start"){
point.lat = ballonContent.lat
point.lon = ballonContent.lon
point.loc = "Start"
var text = document.getElementById('Spunktlat');
text.value = ballonContent.lat;
var text = document.getElementById('Spunktlon');
text.value = ballonContent.lon;
PostNavPoint("Start");
} else if (pointsoe == "End"){
point.lat = ballonContent.lat
point.lon = ballonContent.lon
point.loc = "End"
var text = document.getElementById('Epunktlat');
text.value = ballonContent.lat;
var text = document.getElementById('Epunktlon');
text.value = ballonContent.lon;
PostNavPoint("End");
}
} else {
}
}, Cesium.ScreenSpaceEventType.LEFT_CLICK)
}
}
\ No newline at end of file
...@@ -56,6 +56,7 @@ function showtourSpecific(specify) { ...@@ -56,6 +56,7 @@ function showtourSpecific(specify) {
document.getElementById("UmfrageOne").style.display = "none"; document.getElementById("UmfrageOne").style.display = "none";
document.getElementById("NordbahnhofInfo").style.display = "none"; document.getElementById("NordbahnhofInfo").style.display = "none";
document.getElementById("Energiekonzept").style.display = "none"; document.getElementById("Energiekonzept").style.display = "none";
document.getElementById("Navigation").style.display = "none";
document.getElementById("projektOne").style.display = "block"; document.getElementById("projektOne").style.display = "block";
showTour(); showTour();
...@@ -104,6 +105,7 @@ function EnergiekonzeptFunction(content){ ...@@ -104,6 +105,7 @@ function EnergiekonzeptFunction(content){
document.getElementById("UmfrageOne").style.display = "none"; document.getElementById("UmfrageOne").style.display = "none";
document.getElementById("NordbahnhofInfo").style.display = "none"; document.getElementById("NordbahnhofInfo").style.display = "none";
document.getElementById("Navigation").style.display = "none";
document.getElementById("projektOne").style.display = "none"; document.getElementById("projektOne").style.display = "none";
document.getElementById("Energiekonzept").style.display = "block"; document.getElementById("Energiekonzept").style.display = "block";
showTour(); showTour();
...@@ -224,11 +226,21 @@ function goHome(){ ...@@ -224,11 +226,21 @@ function goHome(){
vcs.vcm.Framework.getInstance().getActiveMap().gotoViewPoint(viewp) vcs.vcm.Framework.getInstance().getActiveMap().gotoViewPoint(viewp)
} }
function Navigationshow() {
document.getElementById("projektOne").style.display = "none";
document.getElementById("Energiekonzept").style.display = "none";
document.getElementById("UmfrageOne").style.display = "none";
document.getElementById("Navigation").style.display = "block";
document.getElementById("NordbahnhofInfo").style.display = "none";
showTour();
}
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
function NordbahnhofText() { function NordbahnhofText() {
document.getElementById("projektOne").style.display = "none"; document.getElementById("projektOne").style.display = "none";
document.getElementById("Energiekonzept").style.display = "none"; document.getElementById("Energiekonzept").style.display = "none";
document.getElementById("UmfrageOne").style.display = "none"; document.getElementById("UmfrageOne").style.display = "none";
document.getElementById("Navigation").style.display = "none";
document.getElementById("NordbahnhofInfo").style.display = "block"; document.getElementById("NordbahnhofInfo").style.display = "block";
showTour(); showTour();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment