Browse Source

Some Geo Features added

master
Evgeny Gagua 3 years ago
parent
commit
d4f244ef7b
  1. 2
      index.php
  2. BIN
      lib/controller/data/mysqlitedb.db
  3. 2
      lib/controller/getDashBoardItems.php
  4. 14
      lib/controller/getSensorEditor.php
  5. 121
      lib/controller/report/node_1.js
  6. 439
      lib/javascript/jsapi_dynamic/mojo_map.js

2
index.php

@ -13,7 +13,7 @@
'rgoose_modules.js',
'mojo_monitoring.js',
'mojo_map.js',
'rgoose_location_editor.js',
//'rgoose_location_editor.js',
'mojo_dashboard.js',
'mojo_users.js',
'mojo_logs.js',

BIN
lib/controller/data/mysqlitedb.db

Binary file not shown.

2
lib/controller/getDashBoardItems.php

@ -106,7 +106,7 @@ lksdlfjlksdfhkjh;
$DUMMY['camera']="{xtype:'panel', id:'pan_ph_ccc_%%ID%%', title: 'Camera Placeholder', frame: true, border: true, draggable: false, layouit: 'fit', items:{$TABA}}";
$DUMMY['sensor']="{xtype:'panel', title: 'Sensor Placeholder', frame: true, border: true, draggable: false, html:'NO SENSOR', listeners:{ afterrender: function(p){ var W=p.getWidth(); p.setHeight( 32+(W/16)*9);}}}";
$DUMMY['map']="{xtype:'panel', title: 'Map', frame: true, border: true, draggable: false, items:[{$MAPIO}],listeners:{ afterrender: function(p){ var W=p.getWidth(); p.setHeight( 32+(W/16)*9); initMapMonitoring();}} }";
$DUMMY['map']="{xtype:'panel', title: 'Map', frame: true, border: true, draggable: false, collapsible: false, tools: [{ id:'toggle', handler: function( a, b, p ){ fullScreen( 'event_map' ); }}], items:[{$MAPIO}],listeners:{ afterrender: function(p){ var W=p.getWidth(); p.setHeight( 32+(W/16)*9); initMapMonitoring();}} }";
$DUMMY['log']="{xtype:'panel', id: 'lg_panel', title: 'Event Log', frame: true, border: true, draggable: false, items:[{$LOGIO}] }";
} else {
$DUMMY['camera']="{xtype:'panel', title: false, frame: true, draggable: false, html: ' ', listeners:{ afterrender: function(p){ var W=p.getWidth(); p.setHeight( 32+(W/16)*9);}}}";

14
lib/controller/getSensorEditor.php

@ -470,7 +470,19 @@ JOJOKA;
xtype: 'panel',
title: 'Position',
height: PanelH - 283,
items:[]
items:[{
xtype: 'panel',
id: 'loc_ed_map',
height: PanelH - 283,
html: ' ',
listeners: {
afterrender: function(p){
//var W=p.getWidth(); p.setHeight( 32+(W/16)*9);
//initMapMonitoring();
loadLocationEditor( 'loc_ed_map', {$CR['type']}, {$CR['id']} );
}
}
}]
},{
xtype: 'panel',
title: 'Maintenence',

121
lib/controller/report/node_1.js

@ -1,96 +1,49 @@
{
id: 'db_node_%%%NODEID%%%',
width: 258,
height: 320,
title: '%%%NODENAME%%%',
draggable: false,
collapsible: false,
tools: [{
id:'gear',
handler: function(){
//Ext.Msg.alert('Message', 'The Settings tool was clicked.');
showSensorToolBox( %%%NODEID%%% );
id:'toggle',
handler: function( a, b, p ){
fsDrawID = %%%NODEID%%%;
fullScreen( 'div_radar_%%%NODEID%%%' );
var el = document.getElementById('draw_svgr_'+fsDrawID );
var nW = Math.floor( ( window.screen.height/window.screen.width ) * 100 );
el.removeAttribute("width");
el.setAttribute( "width", nW+'%' );
}
}],
listeners:{
afterrender: function(){
cleanup2DDraw( %%%NODEID%%% );
drawZoomLevels[%%%NODEID%%%]=100;
//Deffer
afterrender: function(p){
masks_statuses[%%%NODEID%%%] = 0;
masks_exist[%%%NODEID%%%] = 0;
var W=p.getWidth();
var H=9*(W/8);
p.setHeight( H + 32 );
Ext.getCmp( 'cp_radar_%%%NODEID%%%' ).setHeight( H - 18 );
//document.getElementById('draw_svg_%%%NODEID%%%').setAttribute("width", H-45 );
set2DZoomLevel( %%%NODEID%%%, 100 );
var el = document.getElementById('div_radar_%%%NODEID%%%');
el.addEventListener( "fullscreenchange", ( evt )=>{
if( document.fullscreenElement ){
} else {
if( fsDrawID ){
var el = document.getElementById('draw_svgr_'+fsDrawID );
el.removeAttribute("width");
el.setAttribute( "width", '100%' );
fsDrawID = 0;
};
};
});
window.setTimeout( load2DDraw, 10*%%%NODEID%%%, %%%NODEID%%%, 'draw_svgr_' );
}
},
layout: 'hbox',
items:[{
html: '<center><img id="draw_img_%%%NODEID%%%" src="/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%&AUX=100"><canvas id="targ_canvas_%%%NODEID%%%" style="display: none;" onclick="DrawClicker( %%%NODEID%%%, event );" width="200" height="210"></canvas></center>',
height: '260px'
},{
id: 'status_%%%NODEID%%%',
border: true,
frame: true,
height: 36,
html: ''
}],
bbar:[{
xtype: 'button',
text: '12.5%',
enableToggle: true,
id: 'zoom_bt12_%%%NODEID%%%',
toggleGroup: 'zoom_tg_%%%NODEID%%%',
toggleHandler: function( bt, st ){
if( st ){
drawZoomLevels[%%%NODEID%%%]=12;
var img = document.getElementById('draw_img_%%%NODEID%%%');
img.src = "/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%&AUX=12";
img.onload = function(){
cleanup2DDraw( %%%NODEID%%% );
};
};
}
},{
xtype: 'button',
text: '25%',
enableToggle: true,
id: 'zoom_bt25_%%%NODEID%%%',
toggleGroup: 'zoom_tg_%%%NODEID%%%',
toggleHandler: function( bt, st ){
if( st ){
drawZoomLevels[%%%NODEID%%%]=25;
var img = document.getElementById('draw_img_%%%NODEID%%%');
img.src = "/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%&AUX=25";
img.onload = function(){
cleanup2DDraw( %%%NODEID%%% );
};
};
}
},{
xtype: 'button',
text: '50%',
enableToggle: true,
id: 'zoom_bt50_%%%NODEID%%%',
toggleGroup: 'zoom_tg_%%%NODEID%%%',
toggleHandler: function( bt, st ){
if( st ){
drawZoomLevels[%%%NODEID%%%]=50;
var img = document.getElementById('draw_img_%%%NODEID%%%');
img.src = "/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%&AUX=50";
img.onload = function(){
cleanup2DDraw( %%%NODEID%%% );
};
};
}
},{
xtype: 'button',
text: '100%',
pressed: true,
enableToggle: true,
id: 'zoom_bt100_%%%NODEID%%%',
toggleGroup: 'zoom_tg_%%%NODEID%%%',
toggleHandler: function( bt, st ){
if( st ){
drawZoomLevels[%%%NODEID%%%]=100;
var img = document.getElementById('draw_img_%%%NODEID%%%');
img.src = "/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%&AUX=100";
img.onload = function(){
cleanup2DDraw( %%%NODEID%%% );
};
};
}
id: 'cp_radar_%%%NODEID%%%',
html: '<div id="div_radar_%%%NODEID%%%" style="display: block; padding: 5px; width: \'100%\'; height: \'100%\';"><center><svg id="draw_svgr_%%%NODEID%%%" opacity="1.0" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="100%" version="1.1" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd;" viewBox="0 0 574 574" xmlns:xlink="http://www.w3.org/1999/xlink"><text id="g_txt_%%%NODEID%%%" text-anchor="left" transform="rotate(0,35,35)" x="35" y="35" fill="#FFF212" style="font: 30px sans-serif">100 m.</text><circle fill="#00A859" stroke="none" cx="287" cy="287" r="284"/><circle id="border_%%%NODEID%%%" fill="none" stroke="#373435" stroke-width="5.92139" cx="287" cy="287" r="284"/><circle id="r50_%%%NODEID%%%" fill="none" stroke="#FFF212" stroke-width="3.94741" cx="287" cy="287" r="142"/><text id="50_txt_%%%NODEID%%%" text-anchor="left" transform="rotate(45,140,140)" x="140" y="140" fill="#FFF212" style="font: 25px sans-serif">50</text><circle id="r25_%%%NODEID%%%" fill="none" stroke="#FFF212" stroke-width="2.96042" cx="287" cy="287" r="71"/><text id="25_txt_%%%NODEID%%%" text-anchor="left" transform="rotate(45,210,210)" x="210" y="210" fill="#FFF212" style="font: 15px sans-serif">25</text><circle id="r12_%%%NODEID%%%" fill="none" stroke="#FFF212" stroke-width="1.47993" cx="287" cy="287" r="34"/><text id="12_txt_%%%NODEID%%%" text-anchor="left" transform="rotate(45,245,245)" x="245" y="245" fill="#FFF212" style="font: 10px sans-serif">12.5</text><line fill="none" stroke="#FFF212" stroke-width="3.94741" x1="287" y1="3" x2="287" y2="571"/><line fill="none" stroke="#FFF212" stroke-width="3.94741" x1="3" y1="287" x2="571" y2="287"/><circle fill="none" stroke="#373435" stroke-width="5.92139" cx="287" cy="287" r="284"/></svg></center></div>',
width: '100%'
}]
}

439
lib/javascript/jsapi_dynamic/mojo_map.js

@ -3,7 +3,9 @@
var ActiveZones = null;
var map = null;
var map_ed = null;
var markers = [];
function getZoneByNode( nid ){
var rVal = -1;
@ -324,3 +326,438 @@ function initMapMonitoring(){
loadMapZones( 0 );
//getData( 'arch' );
};
var iconSaver = null;
var markerSaver = null;
function updateLocation( e ){
locationSelectedNode = e.target.options.mycustomid;
Ext.Ajax.request({
url: '/lib/controller/updateLocation.php',
params: {
NODE: locationSelectedNode,
SITE: <?=$SiteID;?>,
UID: <?=$UserID;?>,
TYPE: 0,
SID: '<?=$Session;?>',
LAT: e.target._latlng.lat,
LON: e.target._latlng.lng
},
success: function( response, opts ){
loadNodeLocationProps( locationSelectedNode );
},
failure: failureAJAXFunction
});
};
function markerDblClick( e ){
if( iconSaver == null ){
iconSaver = e.target.options.icon;
markerSaver = e.target;
e.target.setIcon( SNAPE_Icon );
for( i=0; i< markers.length; i++){
if( markers[i].options.mycustomid != e.target.options.mycustomid ){
markers[i].setOpacity( 0.1 );
} else {
markers[i].setOpacity( 1.0 );
}
};
} else {
if( e.target.options.mycustomid == markerSaver.options.mycustomid ){
e.target.setIcon( iconSaver );
iconSaver = null;
markerSaver = null;
for( i=0; i< markers.length; i++){
markers[i].setOpacity( 1.0 );
};
} else {
markerSaver.setIcon( iconSaver );
iconSaver = e.target.options.icon;
markerSaver = e.target;
e.target.setIcon( SNAPE_Icon );
for( i=0; i< markers.length; i++){
if( markers[i].options.mycustomid != e.target.options.mycustomid ){
markers[i].setOpacity( 0.1 );
} else {
markers[i].setOpacity( 1.0 );
}
};
};
};
};
function setNodeLocationToAnchor(){
Ext.Ajax.request({
url: '/lib/controller/updateLocation.php',
params: {
NODE: locationSelectedNode,
SITE: <?=$SiteID;?>,
UID: <?=$UserID;?>,
TYPE: 0,
SID: '<?=$Session;?>',
LAT: SiteLat,
LON: SiteLon,
ALT: SiteAlt
},
success: function( response, opts ){
loadLocationEditor();
},
failure: failureAJAXFunction
});
};
function setNodeLocationByDelta(){
var dx = Ext.getCmp('dx').getValue();
var dy = Ext.getCmp('dy').getValue();
var dz = Ext.getCmp('dz').getValue();
Ext.Ajax.request({
url: '/lib/controller/updateLocation.php',
params: {
NODE: locationSelectedNode,
SITE: <?=$SiteID;?>,
UID: <?=$UserID;?>,
TYPE: 3,
SID: '<?=$Session;?>',
LAT: dx,
LON: dy,
ALT: dz
},
success: function( response, opts ){
loadLocationEditor();
},
failure: failureAJAXFunction
});
};
var LRF3D_Icon = L.icon({
iconUrl: '/style/assets/5_node.png',
//shadowUrl: 'leaf-shadow.png',
iconSize: [64, 64], // size of the icon
//shadowSize: [50, 64], // size of the shadow
iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
//shadowAnchor: [4, 62], // the same for the shadow
popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
});
var LFS_Icon = L.icon({
iconUrl: '/style/assets/2_node.png',
//shadowUrl: 'leaf-shadow.png',
iconSize: [64, 64], // size of the icon
//shadowSize: [50, 64], // size of the shadow
iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
//shadowAnchor: [4, 62], // the same for the shadow
popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
});
var PLS200_Icon = L.icon({
iconUrl: '/style/assets/3_node.png',
//shadowUrl: 'leaf-shadow.png',
iconSize: [64, 64], // size of the icon
//shadowSize: [50, 64], // size of the shadow
iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
//shadowAnchor: [4, 62], // the same for the shadow
popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
});
var PLSNET200_Icon = L.icon({
iconUrl: '/style/assets/6_node.png',
//shadowUrl: 'leaf-shadow.png',
iconSize: [64, 64], // size of the icon
//shadowSize: [50, 64], // size of the shadow
iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
//shadowAnchor: [4, 62], // the same for the shadow
popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
});
var PLS360_Icon = L.icon({
iconUrl: '/style/assets/4_node.png',
//shadowUrl: 'leaf-shadow.png',
iconSize: [64, 64], // size of the icon
//shadowSize: [50, 64], // size of the shadow
iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
//shadowAnchor: [4, 62], // the same for the shadow
popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
});
var ALS_Icon = L.icon({
iconUrl: '/style/assets/1_node.png',
//shadowUrl: 'leaf-shadow.png',
iconSize: [64, 64], // size of the icon
//shadowSize: [50, 64], // size of the shadow
iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
//shadowAnchor: [4, 62], // the same for the shadow
popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
});
var PTZCAM_Icon = L.icon({
iconUrl: '/style/assets/12_node.png',
//shadowUrl: 'leaf-shadow.png',
iconSize: [64, 64], // size of the icon
//shadowSize: [50, 64], // size of the shadow
iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
//shadowAnchor: [4, 62], // the same for the shadow
popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
});
var FIXCAM_Icon = L.icon({
iconUrl: '/style/assets/11_node.png',
//shadowUrl: 'leaf-shadow.png',
iconSize: [64, 64], // size of the icon
//shadowSize: [50, 64], // size of the shadow
iconAnchor: [32, 32], // point of the icon which will correspond to marker's location
//shadowAnchor: [4, 62], // the same for the shadow
popupAnchor: [0, -30] // point from which the popup should open relative to the iconAnchor
});
var SITEZ_Icon = L.icon({
iconUrl: '/style/assets/centre_1.png',
//shadowUrl: 'leaf-shadow.png',
iconSize: [32, 32], // size of the icon
//shadowSize: [50, 64], // size of the shadow
iconAnchor: [16, 16], // point of the icon which will correspond to marker's location
//shadowAnchor: [4, 62], // the same for the shadow
popupAnchor: [0, -15] // point from which the popup should open relative to the iconAnchor
});
var SNAPE_Icon = L.icon({
iconUrl: '/style/assets/cursor.png',
//shadowUrl: 'leaf-shadow.png',
iconSize: [32, 32], // size of the icon
//shadowSize: [50, 64], // size of the shadow
iconAnchor: [16, 16], // point of the icon which will correspond to marker's location
//shadowAnchor: [4, 62], // the same for the shadow
popupAnchor: [0, -15] // point from which the popup should open relative to the iconAnchor
});
function loadLocationNodes(){
Ext.Ajax.request({
url: '/lib/controller/getLocationItems.php',
params: {
SITE: <?=$SiteID;?>,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function( response, opts ){
var data = Ext.decode(response.responseText);
for( i=0; i < data.length; i++){
switch( data[i].type ){
case 1:{
markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: ALS_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
break;
};
case 2:{
markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: LFS_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
break;
};
case 3:{
markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: PLS200_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
break;
};
case 4:{
markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: PLS360_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
break;
};
case 5:{
markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: LRF3D_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
break;
};
case 6:{
markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: PLSNET200_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
break;
};
case 10:
case 12:{
markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: FIXCAM_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
break;
};
case 11:
case 13:{
markers[i] = L.marker([data[i].lat, data[i].lon], {draggable: true,icon: PTZCAM_Icon, mycustomid:data[i].id } ).addTo(map).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
break;
};
};
//bindPopup('A pretty CSS3 popup.<br> Easily customizable.');//.openPopup();
};
},
failure: function( response, opts ) {
var tPanel = Ext.getCmp('main_portal');
tPanel.remove(0);
tPanel.add( { html: 'Failed to load dashboard!' } );
tPanel.doLayout();
}
});
};
function loadNodeLocationProps( NodeID ){
//alert( 'Node: ' + NodeID );
Ext.Ajax.request({
url: '/lib/controller/getLocationNodeProps.php',
params: {
NID: <?=$SiteID;?>,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
NODE: NodeID
},
success: function( response, opts ){
// If the response is JSON, you have to decode it
var data = Ext.decode(response.responseText);
var tPanel = Ext.getCmp('prop_content');
tPanel.remove(0);
tPanel.add( data );
tPanel.doLayout();
},
failure: failureAJAXFunction
});
};
function LoadNodesList(){
Ext.Ajax.request({
url: '/lib/controller/getLocationNodes.php',
params: {
SITE: <?=$SiteID;?>,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function( response, opts ){
// If the response is JSON, you have to decode it
var data = Ext.decode(response.responseText);
var tPanel = Ext.getCmp('prop_content');
tPanel.remove(0);
tPanel.add( data );
tPanel.doLayout();
},
failure: failureAJAXFunction
});
};
function loadLocationEditor( el_id , node_type, node_id, lat, lon ){
if( tlInterval!= null ){
window.clearInterval( tlInterval );
tlInterval = null;
timelineObj = null;
};
if( node_type == undefined ) node_type = 0;
if( lat == undefined ){
lat = SiteLat;
lon = SiteLon;
};
map_ed = L.map( el_id,{
attributionControl: true,
//preferCanvas: true,
zoomControl: true,
center: [SiteLat, SiteLon],
/*zoomControl: false,
zoom: 17,
minZoom: 17,
maxZoom: 17,*/
keyboard: false
}).setView([SiteLat, SiteLon], 17);
L.marker([SiteLat, SiteLon], { draggable: false, icon: SITEZ_Icon, zIndexOffset: 1000 } ).addTo(map_ed)/*.on('click', LoadNodesList )*/.bindPopup("<b><?=$Labels->GetLabel('_SYS_ANCHORT_LBL_');?></b>");//.openPopup();
var mapLayers = [];
mapLayers["MyMap"] = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
maxNativeZoom: 18,
maxZoom: 24,
})
// https://leaflet-extras.github.io/leaflet-providers/preview/
mapLayers["EsriStreet"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}', {
attribution: 'Tiles &copy; <a href="https://www.esri.com" target="_blank">Esri</a> &mdash; Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012',
maxZoom: 19
});
mapLayers["EsriSat"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
attribution: 'Tiles &copy; <a href="https://www.esri.com" target="_blank">Esri</a> &mdash; Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community',
maxZoom: 19
});
mapLayers["EsriTopo"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}', {
attribution: 'Tiles &copy; <a href="https://www.esri.com" target="_blank">Esri</a> &mdash; Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Community',
maxZoom: 24
});
mapLayers["OpenStreetMap"] = L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", { //de/tiles/osmde
attribution: 'Map data &copy; <a href="https://openstreetmap.org" target="_blank">OpenStreetMap</a> contributors',
maxZoom: 19
});
mapLayers["OpenTopoMap"] = L.tileLayer("https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png", {
attribution: 'Kartendaten: &copy; <a href="https://openstreetmap.org/copyright" target="_blank">OpenStreetMap</a>-Mitwirkende, SRTM | Kartendarstellung: &copy; <a href="http://opentopomap.org/" target="_blank">OpenTopoMap</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/" target="_blank">CC-BY-SA</a>) ',
maxZoom: 19
});
/*
mapLayers["Cycle"] = L.tileLayer('https://tile.thunderforest.com/cycle/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
attribution: 'Maps &copy; <a href="https://www.thunderforest.com" target="_blank">Thunderforest</a>, Data © <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap contributors</a>',
maxZoom: 22
});
mapLayers["Landscape"] = L.tileLayer('https://tile.thunderforest.com/landscape/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
attribution: 'Maps &copy; <a href="https://www.thunderforest.com" target="_blank">Thunderforest</a>, Data © <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap contributors</a>',
maxZoom: 22
});
mapLayers["Outdoor"] = L.tileLayer('https://tile.thunderforest.com/outdoors/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
attribution: 'Maps &copy; <a href="https://www.thunderforest.com" target="_blank">Thunderforest</a>, Data © <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap contributors</a>',
maxZoom: 22
});
*/
var baseMaps = {
"MyMap": mapLayers["MyMap"],
"OpenStreetMap": mapLayers["OpenStreetMap"],
"OpenTopoMap": mapLayers["OpenTopoMap"],
"EsriSat": mapLayers["EsriSat"],
"EsriStreet": mapLayers["EsriStreet"],
"EsriTopo": mapLayers["EsriTopo"],
//"Bing": mapLayers["Bing"],
//"OSM-Cycle": mapLayers["Cycle"],
//"Landscape": mapLayers["Landscape"],
//"Outdoor": mapLayers["Outdoor"],
};
L.control.layers( baseMaps ).addTo( map_ed );
mapLayers["MyMap"].addTo( map_ed );
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo( map_ed );
if( node_type ){
switch( node_type ){
case 1:{
markers[0] = L.marker([lat,lon], {draggable: true,icon: ALS_Icon, mycustomid: node_id } ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
break;
};
case 2:{
markers[0] = L.marker([lat,lon], {draggable: true,icon: LFS_Icon, mycustomid: node_id } ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
break;
};
case 3:{
markers[0] = L.marker([lat,lon], {draggable: true,icon: PLS200_Icon, mycustomid: node_id } ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
break;
};
case 4:{
markers[0] = L.marker([lat,lon], {draggable: true,icon: PLS360_Icon, mycustomid: node_id } ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
break;
};
case 5:{
markers[0] = L.marker([lat,lon], {draggable: true,icon: LRF3D_Icon, mycustomid: node_id } ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
break;
};
case 6:{
markers[0] = L.marker([lat,lon], {draggable: true,icon: PLSNET200_Icon, mycustomid: node_id } ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
break;
};
case 10:
case 12:{
markers[0] = L.marker([lat,lon], {draggable: true,icon: FIXCAM_Icon, mycustomid: node_id} ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
break;
};
case 11:
case 13:{
markers[0] = L.marker([lat,lon], {draggable: true,icon: PTZCAM_Icon, mycustomid: node_id } ).addTo( map_ed ).on('click', loadLoactionProps ).on('dblclick', markerDblClick ).on('dragend', updateLocation );
break;
};
};
};
//loadLocationNodes();
};
Loading…
Cancel
Save