@ -380,48 +380,68 @@ function initMapMonitoring(){
map . remove ( ) ;
map = null ;
} ;
if ( MAP_SET . type == 1 ) {
map = L . map ( 'event_map' , {
//attributionControl: aK,
attributionControl : false ,
preferCanvas : true ,
zoomControl : true ,
center : [ SiteLat , SiteLon ] ,
/ * z o o m C o n t r o l : f a l s e ,
zoom : 17 ,
minZoom : 17 ,
maxZoom : 17 , * /
keyboard : false
} ) ;
map . setView ( [ SiteLat , SiteLon ] , 17 ) ;
//mapLayers[ MAP_SET.name ] = L.tileLayer( MAP_SET.layer_url, {
// attribution: MAP_SET.attribution,
// maxNativeZoom: MAP_SET.maxNativeZoom,
// maxZoom: MAP_SET.maxZoom
//});
L . tileLayer ( MAP_SET . layer_url , {
attribution : MAP_SET . attribution ,
attributionControl : false ,
maxNativeZoom : MAP_SET . maxNativeZoom ,
//minZoom: 0,
maxZoom : MAP_SET . maxZoom
} ) . addTo ( map ) ;
} else {
map = L . map ( 'event_map' , {
crs : L . CRS . Simple ,
attributionControl : false ,
preferCanvas : true ,
zoomControl : true ,
center : [ SiteLat , SiteLon ] ,
/*zoomControl: false,*/
zoom : 0 ,
minZoom : - 1 ,
maxZoom : 4 ,
keyboard : false
} ) ;
var bounds = [ [ MAP_SET . bounds_lx , MAP_SET . bounds_ly ] , [ MAP_SET . bounds_rx , MAP_SET . bounds_ry ] ] ;
var image = L . imageOverlay ( '/lib/controller/data/assets/images/' + MAP_SET . layer_url , bounds ) . addTo ( map ) ;
//map.setView([SiteLat, SiteLon], -1 );
switch ( MAP_SET . type ) {
case 1 : {
map = L . map ( 'event_map' , {
//attributionControl: aK,
attributionControl : false ,
preferCanvas : true ,
zoomControl : true ,
center : [ SiteLat , SiteLon ] ,
/ * z o o m C o n t r o l : f a l s e ,
zoom : 17 ,
minZoom : 17 ,
maxZoom : 17 , * /
keyboard : false
} ) ;
map . setView ( [ SiteLat , SiteLon ] , 17 ) ;
//mapLayers[ MAP_SET.name ] = L.tileLayer( MAP_SET.layer_url, {
// attribution: MAP_SET.attribution,
// maxNativeZoom: MAP_SET.maxNativeZoom,
// maxZoom: MAP_SET.maxZoom
//});
L . tileLayer ( MAP_SET . layer_url , {
attribution : MAP_SET . attribution ,
attributionControl : false ,
maxNativeZoom : MAP_SET . maxNativeZoom ,
//minZoom: 0,
maxZoom : MAP_SET . maxZoom
} ) . addTo ( map ) ;
break ;
} ;
case 2 : {
map = L . map ( 'event_map' , {
crs : L . CRS . Simple ,
attributionControl : false ,
preferCanvas : true ,
zoomControl : true ,
center : [ SiteLat , SiteLon ] ,
/*zoomControl: false,*/
zoom : 2 ,
minZoom : - 1 ,
maxZoom : 4 ,
keyboard : false
} ) ;
var bounds = [ [ MAP_SET . bounds_lx , MAP_SET . bounds_ly ] , [ MAP_SET . bounds_rx , MAP_SET . bounds_ry ] ] ;
var image = L . imageOverlay ( '/lib/controller/data/assets/images/' + MAP_SET . layer_url , bounds ) . addTo ( map ) ;
//map.setView([SiteLat, SiteLon], -1 );
break ;
} ;
case 3 : {
map = L . map ( 'event_map' , {
attributionControl : false ,
preferCanvas : true ,
zoomControl : true ,
center : [ SiteLat , SiteLon ] ,
zoom : MAP_SET . maxZoom - 2 ,
minZoom : MAP_SET . maxZoom - 4 ,
maxZoom : MAP_SET . maxZoom ,
keyboard : false
} ) ;
var bounds = [ [ MAP_SET . bounds_ly , MAP_SET . bounds_lx ] , [ MAP_SET . bounds_ry , MAP_SET . bounds_rx ] ] ;
var image = L . imageOverlay ( '/lib/controller/data/assets/images/' + MAP_SET . layer_url , bounds ) . addTo ( map ) ;
break ;
} ;
} ;
//ToDo: Fix Initial Zoom level -> May be saving into a user profile
loadMapZones ( 0 ) ;
@ -437,48 +457,68 @@ function initMapReporting(){
map . remove ( ) ;
map = null ;
} ;
if ( MAP_SET . type == 1 ) {
map = L . map ( 'report_map' , {
//attributionControl: aK,
attributionControl : false ,
preferCanvas : true ,
zoomControl : true ,
center : [ SiteLat , SiteLon ] ,
/ * z o o m C o n t r o l : f a l s e ,
zoom : 17 ,
minZoom : 17 ,
maxZoom : 17 , * /
keyboard : false
} ) ;
map . setView ( [ SiteLat , SiteLon ] , 17 ) ;
//mapLayers[ MAP_SET.name ] = L.tileLayer( MAP_SET.layer_url, {
// attribution: MAP_SET.attribution,
// maxNativeZoom: MAP_SET.maxNativeZoom,
// maxZoom: MAP_SET.maxZoom
//});
L . tileLayer ( MAP_SET . layer_url , {
attribution : MAP_SET . attribution ,
attributionControl : false ,
maxNativeZoom : MAP_SET . maxNativeZoom ,
minZoom : 0 ,
maxZoom : MAP_SET . maxZoom
} ) . addTo ( map ) ;
} else {
map = L . map ( 'report_map' , {
crs : L . CRS . Simple ,
attributionControl : false ,
preferCanvas : true ,
zoomControl : true ,
center : [ SiteLat , SiteLon ] ,
/*zoomControl: false,*/
zoom : 0 ,
minZoom : - 1 ,
maxZoom : 4 ,
keyboard : false
} ) ;
var bounds = [ [ MAP_SET . bounds_lx , MAP_SET . bounds_ly ] , [ MAP_SET . bounds_rx , MAP_SET . bounds_ry ] ] ;
var image = L . imageOverlay ( '/lib/controller/data/assets/images/' + MAP_SET . layer_url , bounds ) . addTo ( map ) ;
//map.setView([SiteLat, SiteLon], -1 );
switch ( MAP_SET . type ) {
case 1 : {
map = L . map ( 'report_map' , {
//attributionControl: aK,
attributionControl : false ,
preferCanvas : true ,
zoomControl : true ,
center : [ SiteLat , SiteLon ] ,
/ * z o o m C o n t r o l : f a l s e ,
zoom : 17 ,
minZoom : 17 ,
maxZoom : 17 , * /
keyboard : false
} ) ;
map . setView ( [ SiteLat , SiteLon ] , 17 ) ;
//mapLayers[ MAP_SET.name ] = L.tileLayer( MAP_SET.layer_url, {
// attribution: MAP_SET.attribution,
// maxNativeZoom: MAP_SET.maxNativeZoom,
// maxZoom: MAP_SET.maxZoom
//});
L . tileLayer ( MAP_SET . layer_url , {
attribution : MAP_SET . attribution ,
attributionControl : false ,
maxNativeZoom : MAP_SET . maxNativeZoom ,
minZoom : 0 ,
maxZoom : MAP_SET . maxZoom
} ) . addTo ( map ) ;
break ;
} ;
case 2 : {
map = L . map ( 'report_map' , {
crs : L . CRS . Simple ,
attributionControl : false ,
preferCanvas : true ,
zoomControl : true ,
center : [ SiteLat , SiteLon ] ,
/*zoomControl: false,*/
zoom : 0 ,
minZoom : - 1 ,
maxZoom : 4 ,
keyboard : false
} ) ;
var bounds = [ [ MAP_SET . bounds_lx , MAP_SET . bounds_ly ] , [ MAP_SET . bounds_rx , MAP_SET . bounds_ry ] ] ;
var image = L . imageOverlay ( '/lib/controller/data/assets/images/' + MAP_SET . layer_url , bounds ) . addTo ( map ) ;
//map.setView([SiteLat, SiteLon], -1 );
break ;
} ;
case 3 : {
map = L . map ( 'report_map' , {
attributionControl : false ,
preferCanvas : true ,
zoomControl : true ,
center : [ SiteLat , SiteLon ] ,
zoom : MAP_SET . maxZoom - 2 ,
minZoom : MAP_SET . maxZoom - 4 ,
maxZoom : MAP_SET . maxZoom ,
keyboard : false
} ) ;
var bounds = [ [ MAP_SET . bounds_ly , MAP_SET . bounds_lx ] , [ MAP_SET . bounds_ry , MAP_SET . bounds_rx ] ] ;
var image = L . imageOverlay ( '/lib/controller/data/assets/images/' + MAP_SET . layer_url , bounds ) . addTo ( map ) ;
break ;
} ;
} ;
//ToDo: Fix Initial Zoom level -> May be saving into a user profile
loadMapZones ( 0 ) ;
@ -984,46 +1024,66 @@ function loadLocationEditor( el_id , node_type, node_id, lat, lon ){
map_ed . off ( ) ;
map_ed . remove ( ) ;
} ;
if ( MAP_SET . type == 1 ) {
map_ed = L . map ( el_id , {
attributionControl : aK ,
//preferCanvas: true,
zoomControl : true ,
center : [ SiteLat , SiteLon ] ,
/ * z o o m C o n t r o l : f a l s e ,
zoom : 17 ,
minZoom : 17 ,
maxZoom : 17 , * /
keyboard : false
} ) ;
//mapLayers[ MAP_SET.name ] = L.tileLayer( MAP_SET.layer_url, {
// attribution: MAP_SET.attribution,
// maxNativeZoom: MAP_SET.maxNativeZoom,
// maxZoom: MAP_SET.maxZoom
//});
L . tileLayer ( MAP_SET . layer_url , {
attribution : MAP_SET . attribution ,
maxNativeZoom : MAP_SET . maxNativeZoom ,
minZoom : 0 ,
maxZoom : MAP_SET . maxZoom
} ) . addTo ( map_ed ) ;
} else {
map_ed = L . map ( el_id , {
crs : L . CRS . Simple ,
attributionControl : false ,
preferCanvas : true ,
zoomControl : true ,
center : [ SiteLat , SiteLon ] ,
/*zoomControl: false,*/
zoom : 0 ,
minZoom : 0 ,
maxZoom : 4 ,
keyboard : false
} ) ;
var bounds = [ [ MAP_SET . bounds_lx , MAP_SET . bounds_ly ] , [ MAP_SET . bounds_rx , MAP_SET . bounds_ry ] ] ;
var image = L . imageOverlay ( '/lib/controller/data/assets/images/' + MAP_SET . layer_url , bounds ) . addTo ( map_ed ) ;
}
map_ed . setView ( [ SiteLat , SiteLon ] , MAP_SET . maxZoom ) ;
switch ( MAP_SET . type ) {
case 1 : {
map_ed = L . map ( el_id , {
attributionControl : aK ,
//preferCanvas: true,
zoomControl : true ,
center : [ SiteLat , SiteLon ] ,
/ * z o o m C o n t r o l : f a l s e ,
zoom : 17 ,
minZoom : 17 ,
maxZoom : 17 , * /
keyboard : false
} ) ;
//mapLayers[ MAP_SET.name ] = L.tileLayer( MAP_SET.layer_url, {
// attribution: MAP_SET.attribution,
// maxNativeZoom: MAP_SET.maxNativeZoom,
// maxZoom: MAP_SET.maxZoom
//});
L . tileLayer ( MAP_SET . layer_url , {
attribution : MAP_SET . attribution ,
maxNativeZoom : MAP_SET . maxNativeZoom ,
minZoom : 0 ,
maxZoom : MAP_SET . maxZoom
} ) . addTo ( map_ed ) ;
break ;
} ;
case 2 : {
map_ed = L . map ( el_id , {
crs : L . CRS . Simple ,
attributionControl : false ,
preferCanvas : true ,
zoomControl : true ,
center : [ SiteLat , SiteLon ] ,
/*zoomControl: false,*/
zoom : 0 ,
minZoom : 0 ,
maxZoom : 4 ,
keyboard : false
} ) ;
var bounds = [ [ MAP_SET . bounds_lx , MAP_SET . bounds_ly ] , [ MAP_SET . bounds_rx , MAP_SET . bounds_ry ] ] ;
var image = L . imageOverlay ( '/lib/controller/data/assets/images/' + MAP_SET . layer_url , bounds ) . addTo ( map_ed ) ;
break ;
} ;
case 3 : {
map_ed = L . map ( el_id , {
attributionControl : false ,
preferCanvas : true ,
zoomControl : true ,
center : [ SiteLat , SiteLon ] ,
zoom : MAP_SET . maxZoom - 2 ,
minZoom : MAP_SET . maxZoom - 4 ,
maxZoom : MAP_SET . maxZoom ,
keyboard : false
} ) ;
var bounds = [ [ MAP_SET . bounds_ly , MAP_SET . bounds_lx ] , [ MAP_SET . bounds_ry , MAP_SET . bounds_rx ] ] ;
var image = L . imageOverlay ( '/lib/controller/data/assets/images/' + MAP_SET . layer_url , bounds ) . addTo ( map_ed ) ;
break ;
} ;
} ;
map_ed . setView ( [ SiteLat , SiteLon ] , MAP_SET . maxZoom ) ;
if ( node_type ) {
ed_anchor = L . marker ( [ SiteLat , SiteLon ] , { draggable : false , icon : SITEZ_Icon , zIndexOffset : 1000 } ) . addTo ( map_ed ) . bindPopup ( "<b><?=$Labels->GetLabel('_SYS_ANCHORT_LBL_');?></b>" ) ; //.openPopup();
} else {
@ -1301,7 +1361,7 @@ function createNewMap(){
if ( mapCreatorWindow == null ) {
mapCreatorWindow = new Ext . Window ( {
width : 800 ,
height : 54 0 ,
height : 58 0 ,
title : '<?=$Labels->GetLabel(' _CREATE_CUSTOM_MAP_ ');?>' ,
modal : true ,
frame : true ,
@ -1318,7 +1378,7 @@ function createNewMap(){
fileUpload : true ,
labelWidth : 250 ,
labelAlign : 'right' ,
height : 45 0 ,
height : 49 0 ,
items : [ {
xtype : 'textfield' ,
fieldLabel : '<?=$Labels->GetLabel(' _NAME_MAP_ ');?>' ,
@ -1383,7 +1443,7 @@ function createNewMap(){
title : '<?=$Labels->GetLabel(' _LOCAL_PIC_MAP_ ');?>' ,
id : 'map_pic_frm' ,
fileUpload : true ,
height : 45 0 ,
height : 49 0 ,
//autoHeight: true,
//bodyStyle: 'padding: 10px 10px 0 10px;',
labelWidth : 250 ,
@ -1426,6 +1486,7 @@ function createNewMap(){
fieldLabel : '<?=$Labels->GetLabel(' _MAX_ZOOM_ ');?>' ,
editable : false ,
typeAhead : true ,
id : 'map_maxz' ,
name : 'map_maxz' ,
triggerAction : 'all' ,
width : 100 ,
@ -1435,7 +1496,7 @@ function createNewMap(){
fields : [ 'zoom_l' ] ,
data : [ [ '16' ] , [ '17' ] , [ '18' ] , [ '19' ] , [ '20' ] , [ '21' ] , [ '22' ] , [ '23' ] , [ '24' ] , [ '25' ] , [ '26' ] , [ '27' ] , [ '28' ] ]
} ) ,
value : '16 ' ,
value : '4 ' ,
valueField : 'zoom_l' ,
displayField : 'zoom_l'
} , {
@ -1443,6 +1504,7 @@ function createNewMap(){
fieldLabel : '<?=$Labels->GetLabel(' _MAX_NATURAL_ZOOM_ ');?>' ,
editable : false ,
typeAhead : true ,
id : 'map_maxnz' ,
name : 'map_maxnz' ,
triggerAction : 'all' ,
width : 100 ,
@ -1452,7 +1514,7 @@ function createNewMap(){
fields : [ 'zoom_l' ] ,
data : [ [ '16' ] , [ '17' ] , [ '18' ] , [ '19' ] , [ '20' ] , [ '21' ] , [ '22' ] , [ '23' ] , [ '24' ] , [ '25' ] , [ '26' ] , [ '27' ] , [ '28' ] ]
} ) ,
value : '16 ' ,
value : '4 ' ,
valueField : 'zoom_l' ,
displayField : 'zoom_l'
} , {
@ -1479,9 +1541,46 @@ function createNewMap(){
name : 'map_bpb' ,
value : 0 ,
width : 540 ,
} , {
xtype : 'combo' ,
fieldLabel : '<?=$Labels->GetLabel(' _MAP_COORD_SYSTEM_ ');?>' ,
editable : false ,
typeAhead : true ,
hiddenName : 'map_corsys' ,
triggerAction : 'all' ,
width : 540 ,
lazyRender : true ,
mode : 'local' ,
store : new Ext . data . ArrayStore ( {
fields : [ 'C_SYS_V' , 'C_SYS' ] ,
data : [ [ 0 , 'Meters from map Centre' ] , [ 1 , 'WGS84(GPS)' ] ]
} ) ,
listeners : {
select : function ( a , b , c ) {
if ( c ) {
Ext . getCmp ( 'map_height' ) . hide ( ) ;
Ext . getCmp ( 'map_maxz' ) . hide ( ) ;
Ext . getCmp ( 'map_maxnz' ) . hide ( ) ;
Ext . getCmp ( 'map_width' ) . hide ( ) ;
Ext . getCmp ( 'map_cpp' ) . hide ( ) ;
Ext . getCmp ( 'map_cpb' ) . show ( ) ;
} else {
Ext . getCmp ( 'map_height' ) . show ( ) ;
Ext . getCmp ( 'map_maxz' ) . show ( ) ;
Ext . getCmp ( 'map_maxnz' ) . show ( ) ;
Ext . getCmp ( 'map_width' ) . show ( ) ;
Ext . getCmp ( 'map_cpp' ) . show ( ) ;
Ext . getCmp ( 'map_cpb' ) . hide ( ) ;
} ;
}
} ,
value : '0' ,
valueField : 'C_SYS_V' ,
displayField : 'C_SYS'
} , {
xtype : 'numberfield' ,
fieldLabel : '<?=$Labels->GetLabel(' _MAP_WIDTH_ ');?>' ,
id : 'map_height' ,
name : 'map_height' ,
decimalPrecision : 2 ,
value : 1000.00 ,
@ -1489,12 +1588,14 @@ function createNewMap(){
} , {
xtype : 'numberfield' ,
fieldLabel : '<?=$Labels->GetLabel(' _MAP_HEIGHT_ ');?>' ,
id : 'map_width' ,
name : 'map_width' ,
decimalPrecision : 2 ,
value : 1000.00 ,
width : 540 ,
} , {
xtype : 'panel' ,
id : 'map_cpp' ,
frame : false ,
border : false ,
layout : 'table' ,
@ -1521,6 +1622,69 @@ function createNewMap(){
} , {
html : '<img src="/style/assets/cust_map_cord_sys-1.png">'
} ]
} , {
xtype : 'panel' ,
id : 'map_cpb' ,
frame : false ,
border : false ,
hidden : true ,
layout : 'table' ,
layoutConfig : {
columns : 5
} ,
items : [ {
xtype : 'spacer' ,
width : 250 ,
html : '<p style="text-align:right; margin-right: 5px;"><?=$Labels->GetLabel(' _MAP_LEFT_CORCORD_ ');?>:</p>'
} , {
xtype : 'spacer' ,
width : 100 ,
html : '<p style="text-align:right; margin-right: 5px;"><?=$Labels->GetLabel(' _LAT_ ');?></p>'
} , {
xtype : 'numberfield' ,
id : 'map_lcclat' ,
name : 'map_lcclat' ,
decimalPrecision : 8 ,
value : 32.0001 ,
width : 150 ,
} , {
xtype : 'spacer' ,
width : 100 ,
html : '<p style="text-align:right; margin-right: 5px;"><?=$Labels->GetLabel(' _LON_ ');?></p>'
} , {
xtype : 'numberfield' ,
id : 'map_lcclon' ,
name : 'map_lcclon' ,
decimalPrecision : 8 ,
value : 32.0001 ,
width : 150 ,
} , {
xtype : 'spacer' ,
width : 250 ,
html : '<p style="text-align:right; margin-right: 5px;"><?=$Labels->GetLabel(' _MAP_RIGHT_CORCORD_ ');?>:</p>'
} , {
xtype : 'spacer' ,
width : 100 ,
html : '<p style="text-align:right; margin-right: 5px;"><?=$Labels->GetLabel(' _LAT_ ');?></p>'
} , {
xtype : 'numberfield' ,
id : 'map_rcclat' ,
name : 'map_rcclat' ,
decimalPrecision : 8 ,
value : 32.0001 ,
width : 150 ,
} , {
xtype : 'spacer' ,
width : 100 ,
html : '<p style="text-align:right; margin-right: 5px;"><?=$Labels->GetLabel(' _LON_ ');?></p>'
} , {
xtype : 'numberfield' ,
id : 'map_rcclon' ,
name : 'map_rcclon' ,
decimalPrecision : 8 ,
value : 32.0001 ,
width : 150 ,
} ]
} ]
} ]
} ] ,
@ -1575,12 +1739,27 @@ function createNewMap(){
} ;
var mapEditorWindow = null ;
function deleteCurrentMap ( ) {
Ext . Ajax . request ( {
url : '/lib/controller/delMapData.php' ,
params : {
SITE : < ? = $SiteID ; ? > ,
UID : < ? = $UserID ; ? > ,
SID : '<?=$Session;?>' ,
MID : MAP_ID
} ,
success : function ( response , opts ) {
location . reload ( ) ;
}
} ) ;
} ;
function editCurrentMap ( ) {
Ext . Ajax . request ( {
url : '/lib/controller/getMapData.php' ,
params : {
SITE : < ? = $SiteID ; ? > ,
UID : < ? = $UserID ; ? > ,
SID : '<?=$Session;?>' ,
MID : MAP_ID
} ,
success : function ( response , opts ) {