@ -1,34 +1,30 @@
var $jscomp = $jscomp || { } ; $jscomp . scope = { } ; $jscomp . ASSUME _ES5 = ! 1 ; $jscomp . ASSUME _NO _NATIVE _MAP = ! 1 ; $jscomp . ASSUME _NO _NATIVE _SET = ! 1 ; $jscomp . SIMPLE _FROUND _POLYFILL = ! 1 ; $jscomp . defineProperty = $jscomp . ASSUME _ES5 || "function" == typeof Object . defineProperties ? Object . defineProperty : function ( a , b , c ) { a != Array . prototype && a != Object . prototype && ( a [ b ] = c . value ) } ; $jscomp . getGlobal = function ( a ) { return "undefined" != typeof window && window === a ? a : "undefined" != typeof global && null != global ? global : a } ; $jscomp . global = $jscomp . getGlobal ( this ) ;
var $jscomp = $jscomp || { } ; $jscomp . scope = { } ; $jscomp . ASSUME _ES5 = ! 1 ; $jscomp . ASSUME _NO _NATIVE _MAP = ! 1 ; $jscomp . ASSUME _NO _NATIVE _SET = ! 1 ; $jscomp . SIMPLE _FROUND _POLYFILL = ! 1 ; $jscomp . defineProperty = $jscomp . ASSUME _ES5 || "function" == typeof Object . defineProperties ? Object . defineProperty : function ( a , b , c ) { a != Array . prototype && a != Object . prototype && ( a [ b ] = c . value ) } ;
$jscomp . getGlobal = function ( a ) { a = [ "object" == typeof window && window , "object" == typeof self && self , "object" == typeof global && global , a ] ; for ( var b = 0 ; b < a . length ; ++ b ) { var c = a [ b ] ; if ( c && c . Math == Math ) return c } throw Error ( "Cannot find global object" ) ; } ; $jscomp . global = $jscomp . getGlobal ( this ) ;
$jscomp . polyfill = function ( a , b , c , d ) { if ( b ) { c = $jscomp . global ; a = a . split ( "." ) ; for ( d = 0 ; d < a . length - 1 ; d ++ ) { var e = a [ d ] ; e in c || ( c [ e ] = { } ) ; c = c [ e ] } a = a [ a . length - 1 ] ; d = c [ a ] ; b = b ( d ) ; b != d && null != b && $jscomp . defineProperty ( c , a , { configurable : ! 0 , writable : ! 0 , value : b } ) } } ; $jscomp . polyfill ( "Array.prototype.fill" , function ( a ) { return a ? a : function ( a , c , d ) { var b = this . length || 0 ; 0 > c && ( c = Math . max ( 0 , b + c ) ) ; if ( null == d || d > b ) d = b ; d = Number ( d ) ; 0 > d && ( d = Math . max ( 0 , b + d ) ) ; for ( c = Number ( c || 0 ) ; c < d ; c ++ ) this [ c ] = a ; return this } } , "es6" , "es3" ) ;
$jscomp . polyfill ( "Number.parseInt" , function ( a ) { return a || parseInt } , "es6" , "es3" ) ; $jscomp . polyfill ( "Number.parseFloat" , function ( a ) { return a || parseFloat } , "es6" , "es3" ) ; var netgis = netgis || { } ; netgis . Attribution = function ( ) { this . layers = this . client = null ; this . items = [ ] } ;
netgis . Attribution . prototype . load = function ( ) { this . root = document . createElement ( "section" ) ; this . root . className = "netgis-attribution netgis-text-primary" ; this . items . push ( this . client . config . map . attribution ) ; this . update ( ) ; this . client . root . appendChild ( this . root ) ; this . client . on ( netgis . Events . CONTEXT _UPDATE , this . onContextUpdate . bind ( this ) ) ; this . client . on ( netgis . Events . LAYER _SHOW , this . onLayerShow . bind ( this ) ) ; this . client . on ( netgis . Events . LAYER _HIDE , this . onLayerHide . bind ( this ) ) } ;
netgis . Attribution . prototype . update = function ( ) { this . root . innerHTML = "© " + this . items . join ( ", " ) } ; netgis . Attribution . prototype . onContextUpdate = function ( a ) { this . layers = [ ] ; for ( var b = 0 ; b < a . layers . length ; b ++ ) { var c = a . layers [ b ] ; c . attribution && 0 < c . attribution . length && ( this . layers [ b ] = c . attribution ) } } ; netgis . Attribution . prototype . onLayerShow = function ( a ) { if ( a = this . layers [ a . id ] ) { for ( var b = 0 ; b < this . items . length ; b ++ ) if ( this . items [ b ] === a ) return ; this . items . push ( a ) ; this . update ( ) } } ;
netgis . Attribution . prototype . onLayerHide = function ( a ) { if ( a = this . layers [ a . id ] ) { for ( var b = 0 ; b < this . items . length ; b ++ ) if ( this . items [ b ] === a ) { this . items . splice ( b , 1 ) ; break } this . update ( ) } } ; netgis = netgis || { } ;
netgis . Client = function ( a , b ) { this . build = "20220523" ; this . debug = ! 1 ; netgis . util . isString ( a ) && ( a = document . getElementById ( a ) ) ; this . container = a ; this . editable = ! 0 ; this . root = null ; this . modules = [ ] ; this . callbacks = { } ; this . config = { } ; this . create ( ) ; if ( netgis . util . isString ( b ) ) { var c = this ; netgis . util . request ( b , function ( a ) { a = JSON . parse ( a ) ; c . config = a ; c . createModules ( ) ; c . load ( ) ; c . invoke ( netgis . Events . CONTEXT _UPDATE , c . config ) ; c . hideLoader ( ) } ) } else netgis . util . isDefined ( b ) && ( this . config = b , this . createModules ( ) , this . load ( ) ,
this . invoke ( netgis . Events . CONTEXT _UPDATE , this . config ) , this . hideLoader ( ) ) } ;
$jscomp . polyfill ( "Number.parseInt" , function ( a ) { return a || parseInt } , "es6" , "es3" ) ; $jscomp . polyfill ( "Number.parseFloat" , function ( a ) { return a || parseFloat } , "es6" , "es3" ) ; $jscomp . owns = function ( a , b ) { return Object . prototype . hasOwnProperty . call ( a , b ) } ; $jscomp . assign = "function" == typeof Object . assign ? Object . assign : function ( a , b ) { for ( var c = 1 ; c < arguments . length ; c ++ ) { var d = arguments [ c ] ; if ( d ) for ( var e in d ) $jscomp . owns ( d , e ) && ( a [ e ] = d [ e ] ) } return a } ;
$jscomp . polyfill ( "Object.assign" , function ( a ) { return a || $jscomp . assign } , "es6" , "es3" ) ; var netgis = netgis || { } ; netgis . Attribution = function ( ) { this . layers = this . client = null ; this . items = [ ] } ;
netgis . Attribution . prototype . load = function ( ) { this . root = document . createElement ( "section" ) ; this . root . className = "netgis-attribution netgis-text-primary" ; netgis . util . isDefined ( this . client . config . map ) && netgis . util . isDefined ( this . client . config . map . attribution ) && this . items . push ( this . client . config . map . attribution ) ; this . update ( ) ; this . client . root . appendChild ( this . root ) ; this . client . on ( netgis . Events . CONTEXT _UPDATE , this . onContextUpdate . bind ( this ) ) ; this . client . on ( netgis . Events . LAYER _SHOW , this . onLayerShow . bind ( this ) ) ;
this . client . on ( netgis . Events . LAYER _HIDE , this . onLayerHide . bind ( this ) ) } ; netgis . Attribution . prototype . update = function ( ) { this . root . innerHTML = "© " + this . items . join ( ", " ) } ; netgis . Attribution . prototype . onContextUpdate = function ( a ) { this . layers = [ ] ; for ( var b = 0 ; b < a . layers . length ; b ++ ) { var c = a . layers [ b ] ; c . attribution && 0 < c . attribution . length && ( this . layers [ b ] = c . attribution ) } } ;
netgis . Attribution . prototype . onLayerShow = function ( a ) { if ( a = this . layers [ a . id ] ) { for ( var b = 0 ; b < this . items . length ; b ++ ) if ( this . items [ b ] === a ) return ; this . items . push ( a ) ; this . update ( ) } } ; netgis . Attribution . prototype . onLayerHide = function ( a ) { if ( a = this . layers [ a . id ] ) { for ( var b = 0 ; b < this . items . length ; b ++ ) if ( this . items [ b ] === a ) { this . items . splice ( b , 1 ) ; break } this . update ( ) } } ; netgis = netgis || { } ;
netgis . Client = function ( a , b ) { this . build = "20220826" ; this . debug = ! 1 ; netgis . util . isString ( a ) && ( a = document . getElementById ( a ) ) ; this . container = a ; this . editable = ! 0 ; this . root = null ; this . modules = [ ] ; this . callbacks = { } ; this . config = this . createDefaultConfig ( ) ; this . create ( ) ; if ( netgis . util . isDefined ( b ) ) if ( netgis . util . isString ( b ) ) { var c = this ; netgis . util . request ( b , function ( a ) { a = JSON . parse ( a ) ; netgis . util . merge ( c . config , a ) ; c . createModules ( ) ; c . load ( ) ; c . invoke ( netgis . Events . CONTEXT _UPDATE , c . config ) ; c . hideLoader ( ) } ) } else netgis . util . merge ( this . config , b ) ,
this . createModules ( ) , this . load ( ) , this . invoke ( netgis . Events . CONTEXT _UPDATE , this . config ) , this . hideLoader ( ) ; else this . createModules ( ) , this . load ( ) , this . invoke ( netgis . Events . CONTEXT _UPDATE , this . config ) , this . hideLoader ( ) } ;
netgis . Client . prototype . createDefaultConfig = function ( ) { return { map : { projection : "EPSG:3857" , center : [ 1113194 , 6621293 ] , minZoom : 0 , maxZoom : 20 , zoom : 6 , attribution : "NetGIS" } , projections : [ ] , layers : [ { folder : 0 , type : netgis . LayerTypes . OSM , title : "Open Street Map" , attribution : "OSM Contributors" , active : ! 0 } ] , folders : [ { title : "Hintergrund" , parent : - 1 } ] , styles : { editLayer : { fill : "rgba( 255, 0, 0, 0.5 )" , stroke : "#ff0000" , strokeWidth : 3 , pointRadius : 6 } , select : { fill : "rgba( 0, 127, 255, 0.5 )" , stroke : "#007fff" , strokeWidth : 3 , pointRadius : 6 } ,
sketch : { fill : "rgba( 0, 127, 0, 0.5 )" , stroke : "#007f00" , strokeWidth : 3 , pointRadius : 6 } , modify : { fill : "rgba( 0, 127, 0, 0.5 )" , stroke : "#007f00" , strokeWidth : 3 , pointRadius : 6 } , parcel : { fill : "rgba( 127, 255, 255, 0.5 )" , stroke : "#7fffff" , strokeWidth : 3 } } } } ;
netgis . Client . prototype . create = function ( ) { this . root = document . createElement ( "section" ) ; this . root . className = "netgis-client" ; this . loader = document . createElement ( "div" ) ; this . loader . className = "netgis-loader netgis-dialog netgis-text-primary" ; this . loader . innerHTML = "<i class='fas fa-spinner'></i>" ; this . root . appendChild ( this . loader ) ; this . container . appendChild ( this . root ) } ;
netgis . Client . prototype . createModules = function ( ) { this . editable = ! 0 ; this . container . hasAttribute ( "contenteditable" ) && "false" === this . container . getAttribute ( "contenteditable" ) && ( this . editable = ! 1 ) ; this . container . hasAttribute ( "data-editable" ) && ( this . editable = "true" === this . container . getAttribute ( "data-editable" ) ? ! 0 : ! 1 ) ; this . add ( this . map = new netgis . MapOpenLayers ) ; this . add ( new netgis . Controls ) ; this . add ( new netgis . Attribution ) ; this . add ( new netgis . LayerTree ) ; this . add ( new netgis . Toolbar ) ; this . add ( new netgis . Menu ) ;
this . add ( new netgis . SearchPlace ) ; this . add ( new netgis . Modal ) } ;
netgis . Client . prototype . load = function ( ) { for ( var a = 0 ; a < this . modules . length ; a ++ ) this . modules [ a ] . load ( ) ; this . config . output . id ? ( this . output = document . getElementById ( this . config . output . id ) , this . output . value && 0 < this . output . value . length && ( a = JSON . parse ( this . output . value ) , this . invoke ( netgis . Events . EDIT _FEATURES _LOADED , a ) ) ) : ( this . output = document . createElement ( "input" ) , this . output . setAttribute ( "type" , "hidden" ) , this . output . className = "netgis-edit-output" , this . root . appendChild ( this . output ) ) ; this . invoke ( netgis . Events . SET _MODE ,
netgis . Modes . VIEW ) ; this . on ( netgis . Events . EXPORT _BEGIN , this . onMapExportBegin . bind ( this ) ) ; this . on ( netgis . Events . EXPORT _END , this . onMapExportEnd . bind ( this ) ) ; this . on ( netgis . Events . EDIT _FEATURES _CHANGE , this . onEditFeaturesChange . bind ( this ) ) } ;
netgis . Client . prototype . create = function ( ) { this . root = document . createElement ( "section" ) ; this . root . className = "netgis-client" ; this . loader = document . createElement ( "div" ) ; this . loader . className = "netgis-loader netgis-dialog netgis-text-primary" ; this . loader . innerHTML = "<i class='fas fa-spinner'></i>" ; this . root . appendChild ( this . loader ) ; this . container . appendChild ( this . root ) } ; netgis . Client . prototype . add = function ( a ) { a . client = this ; this . modules . push ( a ) } ;
netgis . Client . prototype . on = function ( a , b ) { netgis . util . isDefined ( this . callbacks [ a ] ) || ( this . callbacks [ a ] = [ ] ) ; this . callbacks [ a ] . push ( b ) } ; netgis . Client . prototype . off = function ( a , b ) { if ( netgis . util . isDefined ( this . callbacks [ a ] ) ) if ( netgis . util . isDefined ( b ) ) { for ( var c = 0 ; c < this . callbacks [ a ] . length ; c ++ ) if ( this . callbacks [ a ] [ c ] === b ) { this . callbacks [ a ] . splice ( c , 1 ) ; break } 1 > this . callbacks [ a ] . length && delete this . callbacks [ a ] } else delete this . callbacks [ a ] } ;
netgis . Client . prototype . invoke = function ( a , b ) { this . debug && console . info ( "EVENT:" , a , b ) ; if ( netgis . util . isDefined ( this . callbacks [ a ] ) ) for ( var c = 0 ; c < this . callbacks [ a ] . length ; c ++ ) this . callbacks [ a ] [ c ] ( b ) } ; netgis . Client . prototype . showLoader = function ( ) { this . loader . classList . remove ( "netgis-hide" ) } ; netgis . Client . prototype . hideLoader = function ( ) { this . loader . classList . add ( "netgis-hide" ) } ; netgis . Client . prototype . onHtmlResponse = function ( a ) { this . root = netgis . util . create ( a ) ; this . container . appendChild ( this . root ) } ;
netgis . Client . prototype . onEditFeaturesChange = function ( a ) { a = JSON . stringify ( a ) ; this . output . value = a } ; netgis . Client . prototype . onMapExportBegin = function ( a ) { this . showLoader ( ) } ; netgis . Client . prototype . onMapExportEnd = function ( a ) { this . hideLoader ( ) } ; netgis = netgis || { } ; netgis . Context = function ( ) { this . client = null } ; netgis . Context . prototype . load = function ( ) { } ; netgis . Context . prototype . request = function ( a ) { netgis . util . request ( a , this . onResponse . bind ( this ) ) } ; netgis . Context . prototype . onResponse = function ( a ) { a = JSON . parse ( a ) ; console . info ( "Response:" , a ) ; this . parseOWS ( a ) } ; netgis . Context . prototype . parseOWS = function ( a ) { var b = a . bbox , c = this . foldersFromOWS ( a ) ; a = this . layersFromOWS ( a , c ) ; this . client . invoke ( netgis . Events . CONTEXT _UPDATE , { folders : c , layers : a , bbox : b } ) } ;
netgis . Context . prototype . foldersFromOWS = function ( a ) { for ( var b = [ ] , c = 0 ; c < a . features . length ; c ++ ) { var d = a . features [ c ] ; if ( "Feature" === d . type ) { var e = d . properties . folder ; e = e . substring ( 1 ) ; var f = e . split ( "/" ) ; 1 === f . length && ( d = d . properties . title , b . push ( { path : e , title : d , parent : - 1 } ) ) } } for ( var g = 1 ; 4 >= g ; g ++ ) for ( c = 0 ; c < a . features . length ; c ++ ) if ( d = a . features [ c ] , "Feature" === d . type && ( e = d . properties . folder , e = e . substring ( 1 ) , f = e . split ( "/" ) , f . length === g + 1 ) ) { d = d . properties . title ; for ( var h = [ ] , k = 0 ; k < f . length - 1 ; k ++ ) h . push ( f [ k ] ) ;
f = h . join ( "/" ) ; for ( h = 0 ; h < b . length ; h ++ ) if ( b [ h ] . path === f ) { b . push ( { path : e , title : d , parent : h } ) ; break } } return b } ;
netgis . Context . prototype . layersFromOWS = function ( a , b ) { for ( var c = [ ] , d = 0 ; d < a . features . length ; d ++ ) { var e = a . features [ d ] ; if ( "Feature" === e . type ) { var f = e . properties . folder ; f = f . substring ( 1 ) ; for ( var g = - 1 , h = 0 ; h < b . length ; h ++ ) if ( b [ h ] . path === f ) { g = h ; break } f = { title : e . properties . title , parent : g , path : f } ; for ( g = 0 ; g < e . offerings . length ; g ++ ) switch ( h = e . offerings [ g ] , h . code ) { case "http://www.opengis.net/spec/owc-atom/1.0/req/kml" : f . type = netgis . LayerTypes . KML ; break ; case "http://www.opengis.net/spec/owc-atom/1.0/req/wms" : for ( var k =
0 ; k < h . operations . length ; k ++ ) { var m = h . operations [ k ] ; "GetMap" === m . code && ( f . type = netgis . LayerTypes . WMS , f . format = m . type , f . url = m . href ) } } c . push ( f ) } } return c } ;
netgis . Context . prototype . foldersFromOWS _02 = function ( a ) { for ( var b = [ ] , c = 0 ; c < a . features . length ; c ++ ) { var d = a . features [ c ] ; if ( "Feature" === d . type ) { for ( var e = d . properties . folder . split ( "/" ) , f = 0 ; f < e . length ; f ++ ) { var g = e [ f ] . trim ( ) , h = - 1 ; if ( 0 !== g . length ) { for ( d = 0 ; d < b . length ; d ++ ) { var k = b [ d ] ; if ( k . title === g ) { h = d ; break } } if ( - 1 === h ) { h = - 1 ; if ( 0 < f ) for ( d = 0 ; d < b . length ; d ++ ) { k = b [ d ] ; var m = f - 1 ; if ( k . title === e [ m ] ) { h = m ; break } } g = { parent : h , title : g } ; b . push ( g ) } } } if ( 0 < e . length ) for ( m = e . length - 1 , e = e [ m ] . trim ( ) , d = 0 ; d < b . length && ( g = b [ d ] , g . title !==
e ) ; d ++ ) ; } } return b } ; netgis . Context . prototype . foldersFromOWS _01 = function ( a ) { for ( var b = [ ] , c = 0 ; c < a . features . length ; c ++ ) { var d = a . features [ c ] ; if ( "Feature" === d . type ) { d = d . properties . folder ; d = d . substring ( 1 ) ; d = d . split ( "/" ) ; for ( var e = 0 ; e < d . length ; e ++ ) for ( var f = 0 ; f < b . length ; f ++ ) ; } else console . info ( "OWS Non Feature:" , d ) } return b } ;
netgis . Context . prototype . parseOWS _01 = function ( a ) { for ( var b = [ ] , c = [ ] , d = 0 ; d < a . features . length ; d ++ ) { var e = a . features [ d ] ; if ( "Feature" === e . type ) { for ( var f = e . properties . folder . split ( "/" ) , g = - 1 , h = 0 ; h < f . length ; h ++ ) { var k = f [ h ] . trim ( ) , m = - 1 ; if ( 0 !== k . length ) { for ( var l = 0 ; l < b . length ; l ++ ) { var n = b [ l ] ; if ( n . title === k ) { m = l ; break } } if ( - 1 === m ) { m = - 1 ; if ( 0 < h ) for ( l = 0 ; l < b . length ; l ++ ) { n = b [ l ] ; var p = h - 1 ; if ( n . title === f [ p ] ) { m = p ; break } } k = { parent : m , title : k } ; b . push ( k ) } } } if ( 0 < f . length ) for ( p = f . length - 1 , f = f [ p ] . trim ( ) , l = 0 ; l < b . length ; l ++ ) if ( k =
b [ l ] , k . title === f ) { g = l ; break } e . offerings [ 0 ] . operations && ( l = { parent : g , title : e . properties . title , text : e . properties . abstract , url : e . offerings [ 0 ] . operations [ 0 ] . href } , c . push ( l ) ) } } console . info ( "Parsed:" , b , c ) ; a = { layers : [ ] , layerGroups : [ ] } ; for ( d = 0 ; d < c . length ; d ++ ) l = c [ d ] , a . layers . push ( { type : netgis . LayerTypes . WMS , title : l . title , url : l . url , name : "OGC:WMS" } ) ; for ( l = 0 ; l < b . length ; l ++ ) k = b [ l ] , a . layerGroups . push ( { title : k . title , layers : [ ] } ) ; this . client . invoke ( netgis . Events . CONTEXT _UPDATE , a ) } ; netgis = netgis || { } ; netgis . Controls = function ( ) { this . client = null } ;
this . add ( new netgis . SearchPlace ) ; this . add ( new netgis . SearchParcel ) ; this . add ( new netgis . Modal ) } ;
netgis . Client . prototype . load = function ( ) { for ( var a = 0 ; a < this . modules . length ; a ++ ) this . modules [ a ] . load ( ) ; netgis . util . isDefined ( this . config . output ) ? netgis . util . isDefined ( this . config . output . id ) && ( this . output = document . getElementById ( this . config . output . id ) , this . output . value && 0 < this . output . value . length && ( a = JSON . parse ( this . output . value ) , this . invoke ( netgis . Events . EDIT _FEATURES _LOADED , a ) ) ) : ( this . output = document . createElement ( "input" ) , this . output . setAttribute ( "type" , "hidden" ) , this . output . className = "netgis-edit-output" ,
this . root . appendChild ( this . output ) ) ; this . invoke ( netgis . Events . SET _MODE , netgis . Modes . VIEW ) ; this . on ( netgis . Events . EXPORT _BEGIN , this . onMapExportBegin . bind ( this ) ) ; this . on ( netgis . Events . EXPORT _END , this . onMapExportEnd . bind ( this ) ) ; this . on ( netgis . Events . EDIT _FEATURES _CHANGE , this . onEditFeaturesChange . bind ( this ) ) } ; netgis . Client . prototype . add = function ( a ) { a . client = this ; this . modules . push ( a ) } ; netgis . Client . prototype . on = function ( a , b ) { netgis . util . isDefined ( this . callbacks [ a ] ) || ( this . callbacks [ a ] = [ ] ) ; this . callbacks [ a ] . push ( b ) } ;
netgis . Client . prototype . off = function ( a , b ) { if ( netgis . util . isDefined ( this . callbacks [ a ] ) ) if ( netgis . util . isDefined ( b ) ) { for ( var c = 0 ; c < this . callbacks [ a ] . length ; c ++ ) if ( this . callbacks [ a ] [ c ] === b ) { this . callbacks [ a ] . splice ( c , 1 ) ; break } 1 > this . callbacks [ a ] . length && delete this . callbacks [ a ] } else delete this . callbacks [ a ] } ; netgis . Client . prototype . invoke = function ( a , b ) { this . debug && console . info ( "EVENT:" , a , b ) ; if ( netgis . util . isDefined ( this . callbacks [ a ] ) ) for ( var c = 0 ; c < this . callbacks [ a ] . length ; c ++ ) this . callbacks [ a ] [ c ] ( b ) } ;
netgis . Client . prototype . showLoader = function ( ) { this . loader . classList . remove ( "netgis-hide" ) } ; netgis . Client . prototype . hideLoader = function ( ) { this . loader . classList . add ( "netgis-hide" ) } ; netgis . Client . prototype . onHtmlResponse = function ( a ) { this . root = netgis . util . create ( a ) ; this . container . appendChild ( this . root ) } ; netgis . Client . prototype . onEditFeaturesChange = function ( a ) { a = JSON . stringify ( a ) ; this . output . value = a } ; netgis . Client . prototype . onMapExportBegin = function ( a ) { this . showLoader ( ) } ;
netgis . Client . prototype . onMapExportEnd = function ( a ) { this . hideLoader ( ) } ; netgis = netgis || { } ; netgis . Controls = function ( ) { this . client = null } ;
netgis . Controls . prototype . load = function ( ) { this . root = document . createElement ( "section" ) ; this . root . className = "netgis-controls" ; var a = document . createElement ( "button" ) ; a . setAttribute ( "type" , "button" ) ; a . innerHTML = "<i class='fas fa-search-plus'></i>" ; a . title = "Hineinzoomen" ; a . addEventListener ( "click" , this . onZoomIn . bind ( this ) ) ; this . root . appendChild ( a ) ; a = document . createElement ( "button" ) ; a . setAttribute ( "type" , "button" ) ; a . innerHTML = "<i class='fas fa-search-minus'></i>" ; a . title = "Herauszoomen" ; a . addEventListener ( "click" ,
this . onZoomOut . bind ( this ) ) ; this . root . appendChild ( a ) ; this . client . root . appendChild ( this . root ) } ; netgis . Controls . prototype . onZoomIn = function ( a ) { this . client . invoke ( netgis . Events . MAP _CHANGE _ZOOM , 1 ) } ; netgis . Controls . prototype . onZoomOut = function ( a ) { this . client . invoke ( netgis . Events . MAP _CHANGE _ZOOM , - 1 ) } ; netgis . Controls . prototype . onSettings = function ( a ) { alert ( "TODO: settings dialog" ) } ; netgis = netgis || { } ;
netgis . Events = Object . freeze ( { CONTEXT _UPDATE : "CONTEXT_UPDATE" , SET _MODE : "SET_MODE" , LAYER _LIST _TOGGLE : "LAYER_LIST_TOGGLE" , PANEL _TOGGLE : "PANEL_TOGGLE" , PANEL _SHOW : "PANEL_SHOW" , PANEL _HIDE : "PANEL_HIDE" , LAYER _SHOW : "LAYER_SHOW" , LAYER _HIDE : "LAYER_HIDE" , LAYER _CREATED : "LAYER_CREATED" , MAP _ SET_EXTENT : "MAP_SET_EXTENT" , MAP _CHANGE _ZOOM : "MAP_CHANGE_ZOOM" , MAP _UPDATE _STYLE : "MAP_UPDATE_STYLE" , MAP _MODE _POINTS : "MAP_MODE_POINTS" , MAP _MODE _LINES : "MAP_MODE_LINES" , MAP _MODE _POLYGONS : "MAP_MODE_POLYGONS" , EDIT _FEATURES _LOADED : "EDIT_FEATURES_LOADED" , EDIT _FEATURES _CHANGE : "EDIT_FEATURES_CHANGE" ,
SEARCH _PLACE _REQUEST : "SEARCH_PLACE_REQUEST" , SEARCH _PLACE _RESPONSE : "SEARCH_PLACE_RESPONSE ", BUFFER _CHANGE : "BUFFER_CHANGE" , BUFFER _ACCEPT : "BUFFER_ACCEPT" , BUFFER _CANCEL : "BUFFER_CANCEL" , SNAP _ON : "SNAP_ON" , SNAP _OFF : "SNAP_OFF" , IMPORT _SHAPEFILE _SHOW : "IMPORT_SHAPEFILE_SHOW" , IMPORT _GEOJSON _SHOW : "IMPORT_GEOJSON_SHOW" , IMPORT _GML _SHOW : "IMPORT_GML_SHOW" , IMPORT _SHAPEFILE : "IMPORT_SHAPEFILE" , IMPORT _GEOJSON : "IMPORT_GEOJSON" , IMPORT _GML : "IMPORT_GML" , EXPORT _PDF _SHOW : "EXPORT_PDF_SHOW" , EXPORT _JPEG _SHOW : "EXPORT_JPEG_SHOW" ,
EXPORT _PNG _SHOW : "EXPORT_PNG_SHOW" , EXPORT _GIF _SHOW : "EXPORT_GIF_SHOW" , EXPORT _PDF : "EXPORT_PDF" , EXPORT _JPEG : "EXPORT_JPEG" , EXPORT _PNG : "EXPORT_PNG" , EXPORT _GIF : "EXPORT_GIF" , EXPORT _BEGIN : "EXPORT_BEGIN" , EXPORT _END : "EXPORT_END" } ) ; netgis = netgis || { } ; netgis . LayerTree = function ( ) { this . folderDraw = this . folderImport = this . list = this . root = this . client = null } ;
netgis . Events = Object . freeze ( { CONTEXT _UPDATE : "CONTEXT_UPDATE" , SET _MODE : "SET_MODE" , LAYER _LIST _TOGGLE : "LAYER_LIST_TOGGLE" , PANEL _TOGGLE : "PANEL_TOGGLE" , PANEL _SHOW : "PANEL_SHOW" , PANEL _HIDE : "PANEL_HIDE" , LAYER _SHOW : "LAYER_SHOW" , LAYER _HIDE : "LAYER_HIDE" , LAYER _CREATED : "LAYER_CREATED" , MAP _ZOOM _WKT : "MAP_ZOOM_WKT" , MAP _SET _EXTENT : "MAP_SET_EXTENT" , MAP _CHANGE _ZOOM : "MAP_CHANGE_ZOOM" , MAP _UPDATE _STYLE : "MAP_UPDATE_STYLE" , MAP _MODE _POINTS : "MAP_MODE_POINTS" , MAP _MODE _LINES : "MAP_MODE_LINES" , MAP _MODE _POLYGONS : "MAP_MODE_POLYGONS" , EDIT _FEATURES _LOADED : "EDIT_FEATURES_LOADED" ,
EDIT _FEATURES _CHANGE : "EDIT_FEATURES_CHANGE" , SEARCH _PLACE _REQUEST : "SEARCH_PLACE_REQUEST" , SEARCH _PLACE _RESPONSE : "SEARCH_PLACE_RESPONSE" , PARCEL _SHOW _PREVIEW : "PARCEL_SHOW_PREVIEW" , PARCEL _HIDE _PREVIEW : "PARCEL_HIDE_PREVIEW" , BUFFER _CHANGE : "BUFFER_CHANGE" , BUFFER _ACCEPT : "BUFFER_ACCEPT" , BUFFER _CANCEL : "BUFFER_CANCEL" , SNAP _ON : "SNAP_ON" , SNAP _OFF : "SNAP_OFF" , IMPORT _SHAPEFILE _SHOW : "IMPORT_SHAPEFILE_SHOW" , IMPORT _GEOJSON _SHOW : "IMPORT_GEOJSON_SHOW" , IMPORT _GML _SHOW : "IMPORT_GML_SHOW" , IMPORT _SHAPEFILE : "IMPORT_SHAPEFILE" ,
IMPORT _GEOJSON : "IMPORT_GEOJSON" , IMPORT _GML : "IMPORT_GML" , IMPORT _WKT : "IMPORT_WKT" , EXPORT _PDF _SHOW : "EXPORT_PDF_SHOW" , EXPORT _JPEG _SHOW : "EXPORT_JPEG_SHOW" , EXPORT _PNG _SHOW : "EXPORT_PNG_SHOW" , EXPORT _GIF _SHOW : "EXPORT_GIF_SHOW" , EXPORT _PDF : "EXPORT_PDF" , EXPORT _JPEG : "EXPORT_JPEG" , EXPORT _PNG : "EXPORT_PNG" , EXPORT _GIF : "EXPORT_GIF" , EXPORT _BEGIN : "EXPORT_BEGIN" , EXPORT _END : "EXPORT_END" } ) ; netgis = netgis || { } ; netgis . LayerTree = function ( ) { this . folderDraw = this . folderImport = this . list = this . root = this . client = null } ;
netgis . LayerTree . prototype . load = function ( ) { this . root = document . createElement ( "section" ) ; this . root . className = "netgis-layer-list netgis-dialog netgis-shadow netgis-hide" ; this . list = document . createElement ( "ul" ) ; this . list . className = "root" ; this . root . appendChild ( this . list ) ; this . client . root . appendChild ( this . root ) ; this . client . on ( netgis . Events . CONTEXT _UPDATE , this . onContextUpdate . bind ( this ) ) ; this . client . on ( netgis . Events . LAYER _LIST _TOGGLE , this . onLayerListToggle . bind ( this ) ) ; this . client . on ( netgis . Events . LAYER _CREATED ,
this . onLayerCreated . bind ( this ) ) ; this . client . on ( netgis . Events . EDIT _FEATURES _CHANGE , this . onEditFeaturesChange . bind ( this ) ) };
this . onLayerCreated . bind ( this ) ) ; this . client . on ( netgis . Events . EDIT _FEATURES _CHANGE , this . onEditFeaturesChange . bind ( this ) ) ; this . client . on ( netgis . Events . SET _MODE , this . onSetMode . bind ( this ) ) } ; netgis . LayerTree . prototype . clearAll = function ( ) { this . list . innerHTML = "" } ;
netgis . LayerTree . prototype . createFolder = function ( a ) { var b = document . createElement ( "li" ) ; b . className = "netgis-folder netgis-hover-light" ; b . setAttribute ( "title" , a ) ; var c = document . createElement ( "label" ) ; c . className = "netgis-icon" ; b . appendChild ( c ) ; var d = document . createElement ( "input" ) ; d . setAttribute ( "type" , "checkbox" ) ; d . addEventListener ( "change" , this . onFolderChange . bind ( this ) ) ; c . appendChild ( d ) ; c = document . createElement ( "button" ) ; c . setAttribute ( "type" , "button" ) ; c . className = "netgis-clip-text netgis-hover-text-primary" ;
c . innerHTML = '<i class="fas fa-folder-open"></i>' + a ; c . addEventListener ( "click" , this . onFolderClick . bind ( this ) ) ; b . appendChild ( c ) ; a = document . createElement ( "ul" ) ; b . appendChild ( a ) ; return b } ;
netgis . LayerTree . prototype . createLayer = function ( a , b , c ) { var d = document . createElement ( "li" ) ; d . setAttribute ( "title" , b ) ; d . className = "netgis-folder-item netgis-hover-text-primary" ; var e = document . createElement ( "label" ) ; e . className = "netgis-label netgis-clip-text" ; d . appendChild ( e ) ; var f = document . createElement ( "span" ) ; f . className = "netgis-icon" ; e . appendChild ( f ) ; var g = document . createElement ( "input" ) ; g . setAttribute ( "type" , "checkbox" ) ; g . dataset . id = a ; g . checked = c ; g . addEventListener ( "change" , this . onItemChange . bind ( this ) ) ;
@ -37,40 +33,42 @@ netgis.LayerTree.prototype.onFolderChange=function(a){var b=a.currentTarget;a=b.
netgis . LayerTree . prototype . updateFolderChecks = function ( a ) { netgis . util . isDefined ( a ) || ( a = this . list ) ; for ( var b = a . getElementsByClassName ( "netgis-folder-item" ) , c = 0 , d = 0 ; d < b . length ; d ++ ) { var e = b [ d ] . getElementsByTagName ( "input" ) [ 0 ] ; e . checked && c ++ } e = a . getElementsByTagName ( "input" ) [ 0 ] ; d = 0 ; 0 < c && ( d = 1 ) ; c === b . length && ( d = 2 ) ; switch ( d ) { case 0 : e . checked = ! 1 ; e . classList . remove ( "netgis-partial" ) ; break ; case 1 : e . checked = ! 0 ; e . classList . add ( "netgis-partial" ) ; break ; case 2 : e . checked = ! 0 , e . classList . remove ( "netgis-partial" ) } ( a =
a . parentElement ) && a !== this . list && ( a = a . parentElement ) && - 1 !== a . className . search ( "netgis-folder" ) && this . updateFolderChecks ( a ) } ;
netgis . LayerTree . prototype . onItemChange = function ( a ) { var b = a . currentTarget ; a = b . checked ; var c = b . parentElement . parentElement . parentElement ; b = parseInt ( b . dataset . id ) ; c = c . parentElement . parentElement ; for ( var d = c . getElementsByTagName ( "input" ) , e = 0 , f = 1 ; f < d . length ; f ++ ) d [ f ] . checked && e ++ ; - 1 !== c . className . search ( "netgis-folder" ) && this . updateFolderChecks ( c ) ; this . client . invoke ( a ? netgis . Events . LAYER _SHOW : netgis . Events . LAYER _HIDE , { id : b } ) } ; netgis . LayerTree . prototype . onLayerListToggle = function ( a ) { this . root . classList . toggle ( "netgis-hide" ) } ;
netgis . LayerTree . prototype . onContextUpdate = function ( a ) { var b = a . folders ; a = a . layers ; for ( var c = [ ] , d = 0 ; d < b . length ; d ++ ) { var e = b [ d ] , f = this . createFolder ( e . title ) ; c . push ( f ) } for ( d = 0 ; d < a . length ; d ++ ) e = a [ d ] , f = this . createLayer ( d , e . title , e . active ) , this . addToFolder ( c [ e . folder ] , f ) ; for ( d = 0 ; d < b . length ; d ++ ) e = b [ d ] , f = c [ d ] , - 1 === e . parent ? this . list . appendChild ( f ) : this . addToFolder ( c [ e . parent ] , f ) ; for ( d = 0 ; d < a . length ; d ++ ) e = a [ d ] , e . active && this . client . invoke ( netgis . Events . LAYER _SHOW , { id : d } ) ; for ( d = 0 ; d < c . length ; d ++ ) this . updateFolderChecks ( c [ d ] ) } ;
netgis . LayerTree . prototype . onContextUpdate = function ( a ) { this . clearAll ( ) ; var b = a . folders ; a = a . layers ; for ( var c = [ ] , d = 0 ; d < b . length ; d ++ ) { var e = b [ d ] , f = this . createFolder ( e . title ) ; c . push ( f ) } for ( d = 0 ; d < a . length ; d ++ ) e = a [ d ] , f = this . createLayer ( d , e . title , e . active ) , this . addToFolder ( c [ e . folder ] , f ) ; for ( d = 0 ; d < b . length ; d ++ ) e = b [ d ] , f = c [ d ] , - 1 === e . parent ? this . list . appendChild ( f ) : this . addToFolder ( c [ e . parent ] , f ) ; for ( d = 0 ; d < a . length ; d ++ ) e = a [ d ] , e . active && this . client . invoke ( netgis . Events . LAYER _SHOW , { id : d } ) ; for ( d = 0 ; d < c . length ; d ++ ) this . updateFolderChecks ( c [ d ] ) } ;
netgis . LayerTree . prototype . onLayerCreated = function ( a ) { var b = this . createLayer ( a . id , a . title , a . checked ) ; if ( "import" === a . folder ) { this . folderImport || ( this . folderImport = this . createFolder ( "Importierte Ebenen" ) , this . list . insertBefore ( this . folderImport , this . folderDraw ? this . folderDraw . nextSibling : this . list . firstChild ) ) ; var c = this . folderImport } else "draw" === a . folder && ( this . folderDraw || ( this . folderDraw = this . createFolder ( "Zeichnung" ) , this . list . insertBefore ( this . folderDraw , this . list . firstChild ) ) , c = this . folderDraw ) ;
this . addToFolder ( c , b , ! 0 ) ; this . updateFolderChecks ( c ) } ; netgis . LayerTree . prototype . onEditFeaturesChange = function ( a ) { if ( this . folderDraw ) { a = this . folderDraw . getElementsByTagName ( "ul" ) [ 0 ] . getElementsByTagName ( "input" ) [ 0 ] ; var b = parseInt ( a . dataset . id ) ; a . checked || ( a . checked = ! 0 , this . updateFolderChecks ( this . folderDraw ) , this . client . invoke ( netgis . Events . LAYER _SHOW , { id : b } ) ) } } ; netgis = netgis || { } ; netgis . LayerTypes = Object . freeze ( { OSM : "OSM" , WMS : "WMS" , WFS : "WFS" , KML : "KML" } ) ; netgis = netgis || { } ; netgis . Map = function ( ) { this . attribution = this . root = this . client = null } ; netgis . Map . prototype . load = function ( ) { this . root = document . createElement ( "section" ) ; this . root . className = "netgis-map" ; this . client . root . appendChild ( this . root ) } ; netgis = netgis || { } ; netgis . MapOpenLayers = function ( ) { netgis . Map . call ( this ) ; this . mode = null ; this . toolbars = { } ; this . map = this . view = null ; this . layers = [ ] ; this . interactions = { } ; this . sketch = this . selected = this . hov er= this . editLayer = this . snapFeatures = this . snap = null ; this . editEventsSilent = ! 1 ; this . importLayerID = 1E3 ; this . editLayerID = 2E3 } ; netgis . MapOpenLayers . prototype = Object . create ( netgis . Map . prototype ) ; netgis . MapOpenLayers . prototype . constructor = netgis . MapOpenLayers ;
this . addToFolder ( c , b , ! 0 ) ; this . updateFolderChecks ( c ) } ; netgis . LayerTree . prototype . onEditFeaturesChange = function ( a ) { if ( this . folderDraw ) { a = this . folderDraw . getElementsByTagName ( "ul" ) [ 0 ] . getElementsByTagName ( "input" ) [ 0 ] ; var b = parseInt ( a . dataset . id ) ; a . checked || ( a . checked = ! 0 , this . updateFolderChecks ( this . folderDraw ) , this . client . invoke ( netgis . Events . LAYER _SHOW , { id : b } ) ) } } ; netgis . LayerTree . prototype . onSetMode = function ( a ) { a === netgis . Modes . SEARCH _PARCEL && this . root . classList . add ( "netgis-hide" ) } ; netgis = netgis || { } ; netgis . LayerTypes = Object . freeze ( { XYZ : "XYZ" , OSM : "OSM" , WMS : "WMS" , WFS : "WFS" , KML : "KML" } ) ; netgis = netgis || { } ; netgis . Map = function ( ) { this . attribution = this . root = this . client = null } ; netgis . Map . prototype . load = function ( ) { this . root = document . createElement ( "section" ) ; this . root . className = "netgis-map" ; this . client . root . appendChild ( this . root ) } ; netgis = netgis || { } ; netgis . MapOpenLayers = function ( ) { netgis . Map . call ( this ) ; this . mode = null ; this . toolbars = { } ; this . map = this . view = null ; this . layers = [ ] ; this . interactions = { } ; this . sketch = this . selected = this . hov er= this . parcelLay er= this . editLayer = this . snapFeatures = this . snap = null ; this . editEventsSilent = ! 1 ; this . importLayerID = 1E3 ; this . editLayerID = 2E3 } ; netgis . MapOpenLayers . prototype = Object . create ( netgis . Map . prototype ) ; netgis . MapOpenLayers . prototype . constructor = netgis . MapOpenLayers ;
netgis . MapOpenLayers . prototype . load = function ( ) { netgis . Map . prototype . load . call ( this ) ; this . dropTarget = document . createElement ( "div" ) ; this . dropTarget . className = "netgis-drop-target netgis-hide" ; this . dropTarget . innerHTML = "Datei hier ablegen!" ; this . root . appendChild ( this . dropTarget ) ; this . root . addEventListener ( "dragenter" , this . onDragEnter . bind ( this ) ) ; this . root . addEventListener ( "dragover" , this . onDragEnter . bind ( this ) ) ; this . root . addEventListener ( "dragend" , this . onDragLeave . bind ( this ) ) ; this . root . addEventListener ( "dragleave" ,
this . onDragLeave . bind ( this ) ) ; this . root . addEventListener ( "drop" , this . onDragDrop . bind ( this ) ) ; this . createMap ( ) ; this . createDefaultLayers ( ) ; this . createInteractions ( ) ; this . client . on ( netgis . Events . CONTEXT _UPDATE , this . onContextUpdate . bind ( this ) ) ; this . client . on ( netgis . Events . EDIT_FEATURES _LOADED , this . onEditFeaturesLoaded . bind ( this ) ) ; this . client . on ( netgis . Events . SET _MODE , this . onSetMode . bind ( this ) ) ; this . client . on ( netgis . Events . SNAP _ON , this . onSnapOn . bind ( this ) ) ; this . client . on ( netgis . Events . SNAP _OFF , this . onSnapOff . bind ( this ) ) ;
this . client . on ( netgis . Events . LAYER _SHOW , this . onLayerShow . bind ( this ) ) ; this . client . on ( netgis . Events . LAYER _HIDE , this . onLayerHide . bind ( this ) ) ; this . client . on ( netgis . Events . MAP _ SET_EXTENT , this . onSetExtent . bind ( this ) ) ; this . client . on ( netgis . Events . MAP _CHANGE _ZOOM , this . onChangeZoom . bind ( this ) ) ; this . client . on ( netgis . Events . BUFFER _CHANGE , this . onBufferChange . bind ( this ) ) ; this . client . on ( netgis . Events . BUFFER _ACCEPT , this . onBufferAccept . bind ( this ) ) ; this . client . on ( netgis . Events . BUFFER _CANCEL , this . onBufferCancel . bind ( this ) ) ;
this . client . on ( netgis . Events . IMPORT_GEOJSON , this . onImportGeoJSON . bind ( this ) ) ; this . client . on ( netgis . Events . IMPORT_GML , this . onImportGML . bind ( this ) ) ; this . client . on ( netgis . Events . IMPORT _ SHAPEFILE, this . onImportShapefile . bind ( this ) ) ; this . client . on ( netgis . Events . EXPORT_PDF , this . onExportPDF . bind ( this ) ) ; this . client . on ( netgis . Events . EXPORT_JPEG , this . onExportJPEG . bind ( this ) ) ; this . client . on ( netgis . Events . EXPORT_PNG , this . onExportPNG . bind ( this ) ) ; this . client . on ( netgis . Events . EXPORT _ GIF, this . onExportGI F. bind ( this ) ) ;
this . client . on ( netgis . Events . MAP_UPDATE _STYLE , this . onUpdateStyle . bind ( this ) ) } ;
netgis . MapOpenLayers . prototype . createMap = function ( ) { proj4 . defs ( this . client . config . projections ) ; proj4 . defs ( "urn:ogc:def:crs:OGC:1.3:CRS84" , proj4 . defs ( "EPSG:4326" ) ) ; ol . proj . proj4 . register ( proj4 ) ;this . view = new ol . View ( { projection : this . client . config . map . projection , center : this . client . config . map . center , minZoom : this . client . config . map . minZoom , maxZoom : this . client . config . map . maxZoom , zoom : this . client . config . map . zoom } ) ; this . map = new ol . Map ( { target : this . root , view : this . view , pixelRatio : 1 , moveTolerance : 5 , controls : [ ] } ) ;
this . map . on ( "pointermove" , this . onPointerMove . bind ( this ) ) ; this . map . on ( "click" , this . onSingleClick . bind ( this ) ) ; this . map . on ( "movestart" , this . onMoveStart . bind ( this ) ) ; this . map . on ( "moveend" , this . onMoveEnd . bind ( this ) ) ; this . view . on ( "change:resolution" , this . onChangeResolution . bind ( this ) ) } ;
netgis . MapOpenLayers . prototype . createDefaultLayers = function ( ) { this . editLayer = new ol . layer . Vector ( { source : new ol . source . Vector ( { features : [ ] } ) , style : this . styleEdit . bind ( this ) , zIndex : this . editLayerID } ) ; this . map . addLayer ( this . editLayer ) ; this . editEventsOn( ) } ; netgis . MapOpenLayers . prototype . editEventsOn = function ( ) { this . editLayer . getSource ( ) . on ( "addfeature" , this . onEditLayerAdd . bind ( this ) ) ; this . editLayer . getSource ( ) . on ( "removefeature" , this . onEditLayerRemove . bind ( this ) ) } ;
netgis . MapOpenLayers . prototype . editEventsOff = function ( ) { } ;
this . onDragLeave . bind ( this ) ) ; this . root . addEventListener ( "drop" , this . onDragDrop . bind ( this ) ) ; this . createMap ( ) ; this . createDefaultLayers ( ) ; this . createInteractions ( ) ; this . client . on ( netgis . Events . CONTEXT _UPDATE , this . onContextUpdate . bind ( this ) ) ; this . client . on ( netgis . Events . MAP_UPDATE _STYLE , this . onUpdateStyle . bind ( this ) ) ; this . client . on ( netgis . Events . EDIT_FEATURES _LOADED , this . onEditFeaturesLoaded . bind ( this ) ) ; this . client . on ( netgis . Events . SET _MODE , this . onSetMode . bind ( this ) ) ; this . client . on ( netgis . Events . SNAP _ON ,
this . onSnapOn . bind ( this ) ) ; this . client . on ( netgis . Events . SNAP _OFF , this . onSnapOff . bind ( this ) ) ; this . client . on ( netgis . Events . LAYER _SHOW , this . onLayerShow . bind ( this ) ) ; this . client . on ( netgis . Events . LAYER _HIDE , this . onLayerHide . bind ( this ) ) ; this . client . on ( netgis . Events . MAP _ ZOOM_WKT , this . onZoomWKT . bind ( this ) ) ; this . client . on ( netgis . Events . MAP _ SET_EXTENT , this . onSetExtent . bind ( this ) ) ; this . client . on ( netgis . Events . MAP _CHANGE _ZOOM , this . onChangeZoom . bind ( this ) ) ; this . client . on ( netgis . Events . BUFFER _CHANGE , this . onBufferChange . bind ( this ) ) ;
this . client . on ( netgis . Events . BUFFER_ACCEPT , this . onBufferAccept . bind ( this ) ) ; this . client . on ( netgis . Events . BUFFER_CANCEL , this . onBufferCancel . bind ( this ) ) ; this . client . on ( netgis . Events . IMPORT _ GEOJSON, this . onImportGeoJSON . bind ( this ) ) ; this . client . on ( netgis . Events . IMPORT_GML , this . onImportGML . bind ( this ) ) ; this . client . on ( netgis . Events . IMPORT_SHAPEFILE , this . onImportShapefile . bind ( this ) ) ; this . client . on ( netgis . Events . IMPORT_WKT , this . onImportWKT . bind ( this ) ) ; this . client . on ( netgis . Events . EXPORT _ PDF, this . onExportPD F. bind ( this ) ) ;
this . client . on ( netgis . Events . EXPORT_JPEG , this . onExportJPEG . bind ( this ) ) ; this . client . on ( netgis . Events . EXPORT _PNG , this . onExportPNG . bind ( this ) ) ; this . client . on ( netgis . Events . EXPORT _GIF , this . onExportGIF . bind ( this ) ) ; this . client . on ( netgis . Events . PARCEL _SHOW _PREVIEW , this . onParcelShowPreview . bind ( this ) ) ; this . client . on ( netgis . Events . PARCEL _HIDE _PREVIEW , this . onParcelHidePreview . bind ( this ) ) } ;
netgis . MapOpenLayers . prototype . createMap = function ( ) { var a = this . client . config ; "undefined" !== typeof proj4 && ( proj4 . defs ( a . projections ) , proj4 . defs ( "urn:ogc:def:crs:OGC:1.3:CRS84" , proj4 . defs ( "EPSG:4326" ) ) , ol . proj . proj4 . register ( proj4 ) ) ;this . view = new ol . View ( { projection : a . map . projection , center : a . map . center , minZoom : a . map . minZoom , maxZoom : a . map . maxZoom , zoom : a . map . zoom } ) ; this . map = new ol . Map ( { target : this . root , view : this . view , pixelRatio : 1 , moveTolerance : 5 , controls : [ ] } ) ; this . map . on ( "pointermove" , this . onPointerMove . bind ( this ) ) ;
this . map . on ( "click" , this . onSingleClick . bind ( this ) ) ; this . map . on ( "movestart" , this . onMoveStart . bind ( this ) ) ; this . map . on ( "moveend" , this . onMoveEnd . bind ( this ) ) ; this . view . on ( "change:resolution" , this . onChangeResolution . bind ( this ) ) } ;
netgis . MapOpenLayers . prototype . createDefaultLayers = function ( ) { this . editLayer = new ol . layer . Vector ( { source : new ol . source . Vector ( { features : [ ] } ) , style : this . styleEdit . bind ( this ) , zIndex : this . editLayerID } ) ; this . map . addLayer ( this . editLayer ) ; this . parcelLayer= new ol . layer . Vector ( { source : new ol . source . Vector ( { features : [ ] } ) , style : this . styleParcel . bind ( this ) , zIndex : this . editLayerID + 10 } ) ; this . map . addLayer ( this . parcelLayer ) ; this . editEventsOn ( ) } ;
netgis . MapOpenLayers . prototype . editEventsOn = function ( ) { this . editLayer . getSource ( ) . on ( "addfeature" , this . onEditLayerAdd . bind ( this ) ) ; this . editLayer . getSource ( ) . on ( "removefeature" , this . onEditLayerRemove . bind ( this ) ) } ; netgis . MapOpenLayers . prototype . editEventsOff = function ( ) { } ;
netgis . MapOpenLayers . prototype . createInteractions = function ( ) { this . interactions [ netgis . Modes . VIEW ] = [ new ol . interaction . DragPan , new ol . interaction . MouseWheelZoom ] ; this . interactions [ netgis . Modes . PANNING ] = this . interactions [ netgis . Modes . VIEW ] ; this . interactions [ netgis . Modes . ZOOMING _IN ] = this . interactions [ netgis . Modes . VIEW ] ; this . interactions [ netgis . Modes . ZOOMING _OUT ] = this . interactions [ netgis . Modes . VIEW ] ; this . interactions [ netgis . Modes . DRAW _POINTS ] = [ new ol . interaction . Draw ( { type : "Point" , source : this . editLayer . getSource ( ) ,
style : this . styleSketch . bind ( this ) } ) , new ol . interaction . DragPan , new ol . interaction . MouseWheelZoom ] ; this . interactions [ netgis . Modes . DRAW _LINES ] = [ new ol . interaction . Draw ( { type : "LineString" , source : this . editLayer . getSource ( ) , style : this . styleSketch . bind ( this ) } ) , new ol . interaction . DragPan , new ol . interaction . MouseWheelZoom ] ; this . interactions [ netgis . Modes . DRAW _POLYGONS ] = [ new ol . interaction . Draw ( { type : "Polygon" , source : this . editLayer . getSource ( ) , style : this . styleSketch . bind ( this ) } ) , new ol . interaction . DragPan ,
new ol . interaction . MouseWheelZoom ] ; this . interactions [ netgis . Modes . CUT _FEATURE _BEGIN ] = [ new ol . interaction . DragPan , new ol . interaction . MouseWheelZoom ] ; this . interactions [ netgis . Modes . CUT _FEATURE _DRAW ] = [ new ol . interaction . Draw ( { type : "Polygon" , style : this . styleSketch . bind ( this ) } ) , new ol . interaction . DragPan , new ol . interaction . MouseWheelZoom ] ; this . interactions [ netgis . Modes . CUT _FEATURE _DRAW ] [ 0 ] . on ( "drawend" , this . onCutFeatureDrawEnd . bind ( this ) ) ; this . interactions [ netgis . Modes . MODIFY _FEATURES ] = [ new ol . interaction . Modify ( { source : this . editLayer . getSource ( ) ,
deleteCondition : ol . events . condition . doubleClick , style : this . styleModify . bind ( this ) } ) , new ol . interaction . MouseWheelZoom ] ; this . interactions [ netgis . Modes . MODIFY _FEATURES ] [ 0 ] . on ( "modifyend" , this . onModifyFeaturesEnd . bind ( this ) ) ; this . interactions [ netgis . Modes . DELETE _FEATURES ] = [ new ol . interaction . DragPan , new ol . interaction . MouseWheelZoom ] ; this . interactions [ netgis . Modes . BUFFER _FEATURE _BEGIN ] = [ new ol . interaction . DragPan , new ol . interaction . MouseWheelZoom ] ; this . interactions [ netgis . Modes . BUFFER _FEATURE _EDIT ] =
[ new ol . interaction . DragPan , new ol . interaction . MouseWheelZoom ] ; this . snapFeatures = new ol . Collection ; this . interactions [ netgis . Modes . SEARCH _PLACE ] = [ new ol . interaction . DragPan , new ol . interaction . MouseWheelZoom ] } ;
netgis . MapOpenLayers . prototype . createLayer = function ( a ) { switch ( a . type ) { case netgis . LayerTypes . OSM : var b = new ol . layer . Tile ( { source : new ol . source . XYZ ( { url : "https://{a-c}.tile.openstreetmap.de/{z}/{x}/{y}.png" , crossOrigin : "anonymous" } ) } ) ; return b ; case netgis . LayerTypes . WMS : var c = { url : a . url , params : { LAYERS : a . name , FORMAT : "image/png" , TRANSPARENT : "true" , VERSION : "1.1.1" } , serverType : "mapserver" , crossOrigin : "anonymous" , hidpi : ! 1 } ; a . username && a . password && ( c . imageLoadFunction = function ( b , c ) { var d = new XMLHttpRequest ;
d . open ( "GET" , c ) ; d . setRequestHeader ( "Authorization" , "Basic " + window . btoa ( a . username + ":" + a . password ) ) ; d . onload = function ( ) { b . getImage ( ) . src = c } ; d . send ( ) } ) ; c = new ol . source . ImageWMS ( c ) ; return b = new ol . layer . Image ( { source : c , opacity : 1 } ) ; case netgis . LayerTypes . WFS : var d = this . client . config , e = a . url + "service=WFS&version=1.1.0&request=GetFeature&outputformat=application/json" ; c = new ol . source . Vector ( { format : new ol . format . GeoJSON , strategy : ol . loadingstrategy . bbox , url : function ( b ) { return e + "&typename=" + a . name + "&srsname=" +
d . map . projection + "&bbox=" + b . join ( "," ) + "," + d . map . projection } } ) ; b = new ol . layer . Vector ( { source : c } ) ; var f = this ; c . on ( "featuresloadstart" , function ( a ) { f . removeSnapLayer ( b ) } ) ; c . on ( "featuresloadend" , function ( a ) { window . setTimeout ( function ( ) { f . addSnapLayer ( b ) } , 10 ) } ) ; return b } return null } ; netgis . MapOpenLayers . prototype . onUpdateStyle = function ( a ) { a = new ol . style . Style ( { fill : new ol . style . Fill ( { color : a . polygon . fill } ) , stroke : new ol . style . Stroke ( { color : a . polygon . stroke , width : a . polygon . strokeWidth } ) } ) ; this . editLayer . setStyle ( a ) } ;
[ new ol . interaction . DragPan , new ol . interaction . MouseWheelZoom ] ; this . snapFeatures = new ol . Collection ; this . interactions [ netgis . Modes . SEARCH _PLACE ] = [ new ol . interaction . DragPan , new ol . interaction . MouseWheelZoom ] ; this . interactions [ netgis . Modes . SEARCH _PARCEL ] = this . interactions [ netgis . Modes . VIEW ] } ;
netgis . MapOpenLayers . prototype . createLayer = function ( a ) { switch ( a . type ) { case netgis . LayerTypes . XYZ : var b = new ol . layer . Tile ( { source : new ol . source . XYZ ( { url : a . url , crossOrigin : "anonymous" } ) } ) ; return b ; case netgis . LayerTypes . OSM : return b = new ol . layer . Tile ( { source : new ol . source . XYZ ( { url : "https://{a-c}.tile.openstreetmap.de/{z}/{x}/{y}.png" , crossOrigin : "anonymous" } ) } ) ; case netgis . LayerTypes . WMS : var c = { url : a . url , params : { LAYERS : a . name , FORMAT : "image/png" , TRANSPARENT : "true" , VERSION : "1.1.1" } , serverType : "mapserver" ,
crossOrigin : "anonymous" , hidpi : ! 1 } ; a . username && a . password && ( c . imageLoadFunction = function ( b , c ) { var d = new XMLHttpRequest ; d . open ( "GET" , c ) ; d . setRequestHeader ( "Authorization" , "Basic " + window . btoa ( a . username + ":" + a . password ) ) ; d . onload = function ( ) { b . getImage ( ) . src = c } ; d . send ( ) } ) ; c = new ol . source . ImageWMS ( c ) ; return b = new ol . layer . Image ( { source : c , opacity : 1 } ) ; case netgis . LayerTypes . WFS : var d = this . client . config , e = a . url + "service=WFS&version=1.1.0&request=GetFeature&outputformat=application/json" ; c = new ol . source . Vector ( { format : new ol . format . GeoJSON ,
strategy : ol . loadingstrategy . bbox , url : function ( b ) { return e + "&typename=" + a . name + "&srsname=" + d . map . projection + "&bbox=" + b . join ( "," ) + "," + d . map . projection } } ) ; b = new ol . layer . Vector ( { source : c } ) ; var f = this ; c . on ( "featuresloadstart" , function ( a ) { f . removeSnapLayer ( b ) } ) ; c . on ( "featuresloadend" , function ( a ) { window . setTimeout ( function ( ) { f . addSnapLayer ( b ) } , 10 ) } ) ; return b } return null } ;
netgis . MapOpenLayers . prototype . clearAll = function ( ) { for ( var a = 0 ; a < this . layers . length ; a ++ ) this . map . removeLayer ( this . layers [ a ] ) ; this . layers = [ ] ; this . snapFeatures . clear ( ) } ; netgis . MapOpenLayers . prototype . onUpdateStyle = function ( a ) { a = new ol . style . Style ( { fill : new ol . style . Fill ( { color : a . polygon . fill } ) , stroke : new ol . style . Stroke ( { color : a . polygon . stroke , width : a . polygon . strokeWidth } ) } ) ; this . editLayer . setStyle ( a ) } ;
netgis . MapOpenLayers . prototype . styleEdit = function ( ) { return new ol . style . Style ( { image : new ol . style . Circle ( { radius : this . client . config . styles . editLayer . pointRadius , fill : new ol . style . Fill ( { color : this . client . config . styles . editLayer . stroke } ) } ) , fill : new ol . style . Fill ( { color : this . client . config . styles . editLayer . fill } ) , stroke : new ol . style . Stroke ( { color : this . client . config . styles . editLayer . stroke , width : this . client . config . styles . editLayer . strokeWidth } ) } ) } ;
netgis . MapOpenLayers . prototype . styleSelect = function ( a ) { return new ol . style . Style ( { image : new ol . style . Circle ( { radius : this . client . config . styles . select . pointRadius , fill : new ol . style . Fill ( { color : this . client . config . styles . select . stroke } ) } ) , fill : new ol . style . Fill ( { color : this . client . config . styles . select . fill } ) , stroke : new ol . style . Stroke ( { color : this . client . config . styles . select . stroke , width : this . client . config . styles . select . strokeWidth } ) } ) } ;
netgis . MapOpenLayers . prototype . styleModify = function ( a ) { var b = new ol . style . Style ( { image : new ol . style . Circle ( { radius : this . client . config . styles . modify . pointRadius , fill : new ol . style . Fill ( { color : this . client . config . styles . modify . stroke } ) } ) , fill : new ol . style . Fill ( { color : this . client . config . styles . modify . fill } ) , stroke : new ol . style . Stroke ( { color : this . client . config . styles . modify . stroke , width : this . client . config . styles . modify . strokeWidth } ) } ) ; a = new ol . style . Style ( { image : new ol . style . Circle ( { radius : this . client . config . styles . modify . pointRadius ,
fill : new ol . style . Fill ( { color : this . client . config . styles . modify . stroke } ) } ) , geometry : this . getGeometryPoints ( a ) } ) ; return [ b , a ] } ;
netgis . MapOpenLayers . prototype . styleSketch = function ( a ) { var b = new ol . style . Style ( { image : new ol . style . Circle ( { radius : this . client . config . styles . sketch . pointRadius , fill : new ol . style . Fill ( { color : this . client . config . styles . sketch . stroke } ) } ) , fill : new ol . style . Fill ( { color : this . client . config . styles . sketch . fill } ) , stroke : new ol . style . Stroke ( { color : this . client . config . styles . sketch . stroke , width : this . client . config . styles . sketch . strokeWidth } ) } ) ; a = new ol . style . Style ( { image : new ol . style . Circle ( { radius : this . client . config . styles . sketch . pointRadius ,
fill : new ol . style . Fill ( { color : this . client . config . styles . sketch . stroke } ) } ) , geometry : this . getGeometryPoints ( a ) } ) ; return [ b , a ] } ;
fill : new ol . style . Fill ( { color : this . client . config . styles . sketch . stroke } ) } ) , geometry : this . getGeometryPoints ( a ) } ) ; return [ b , a ] } ; netgis . MapOpenLayers . prototype . styleParcel = function ( ) { return new ol . style . Style ( { fill : new ol . style . Fill ( { color : this . client . config . styles . parcel . fill } ) , stroke : new ol . style . Stroke ( { color : this . client . config . styles . parcel . stroke , width : this . client . config . styles . parcel . strokeWidth } ) } ) } ;
netgis . MapOpenLayers . prototype . getGeometryPoints = function ( a ) { var b = a . getGeometry ( ) ; if ( b instanceof ol . geom . LineString ) return new ol . geom . MultiPoint ( b . getCoordinates ( ) ) ; if ( b instanceof ol . geom . Polygon ) { a = [ ] ; b = b . getCoordinates ( ) ; for ( var c = 0 ; c < b . length ; c ++ ) for ( var d = b [ c ] , e = 0 ; e < d . length ; e ++ ) a . push ( d [ e ] ) ; return new ol . geom . MultiPoint ( a ) } if ( b instanceof ol . geom . MultiPolygon ) { a = [ ] ; for ( var f = b . getPolygons ( ) , g = 0 ; g < f . length ; g ++ ) for ( b = f [ g ] . getCoordinates ( ) , c = 0 ; c < b . length ; c ++ ) for ( d = b [ c ] , e = 0 ; e < d . length ; e ++ ) a . push ( d [ e ] ) ;
return new ol . geom . MultiPoint ( a ) } if ( b instanceof ol . geom . MultiLineString ) { a = [ ] ; f = b . getPolygons ( ) ; for ( g = 0 ; g < f . length ; g ++ ) for ( b = f [ g ] . getCoordinates ( ) , c = 0 ; c < b . length ; c ++ ) for ( d = b [ c ] , e = 0 ; e < d . length ; e ++ ) a . push ( d [ e ] ) ; return new ol . geom . MultiPoint ( a ) } return b } ; netgis . MapOpenLayers . prototype . getActiveVectorLayers = function ( ) { for ( var a = [ ] , b = this . map . getLayers ( ) . getArray ( ) , c = this . layers , d = 0 ; d < c . length ; d ++ ) { var e = c [ d ] ; e instanceof ol . layer . Vector && - 1 < b . indexOf ( e ) && a . push ( e ) } return a } ;
netgis . MapOpenLayers . prototype . setMode = function ( a ) { switch ( this . mode ) { case netgis . Modes . BUFFER _FEATURE _EDIT : this . onBufferCancel ( null ) } this . map . getInteractions ( ) . clear ( ) ; var b = this . interactions [ a ] ; if ( b ) for ( var c = 0 ; c < b . length ; c ++ ) this . map . addInteraction ( b [ c ] ) ; this . snap && ( a === netgis . Modes . DRAW _POINTS || a === netgis . Modes . DRAW _LINES || a === netgis . Modes . DRAW _POLYGONS ) && this . map . addInteraction ( this . snap ) ; switch ( a ) { default : this . editLayer . setStyle ( this . styleEdit . bind ( this ) ) ; break ; case netgis . Modes . MODIFY _FEATURES : this . editLayer . setStyle ( this . styleModify . bind ( this ) ) } this . mode &&
this . root . classList . remove ( this . getModeClassName ( this . mode ) ) ; a && this . root . classList . add ( this . getModeClassName ( a ) ) ; this . mode = a } ; netgis . MapOpenLayers . prototype . getModeClassName = function ( a ) { a = a . toLowerCase ( ) ; a = netgis . util . replace ( a , "_" , "-" ) ; return "netgis-mode-" + a } ; netgis . MapOpenLayers . prototype . setSnapOn = function ( ) { this . snap = new ol . interaction . Snap ( { features : this . snapFeatures } ) ; this . map . addInteraction ( this . snap ) ; this . snapFeatures . changed ( ) } ;
netgis . MapOpenLayers . prototype . setSnapOff = function ( ) { this . snap && ( this . map . removeInteraction ( this . snap ) , this . snap = null ) } ; netgis . MapOpenLayers . prototype . addSnapLayer = function ( a ) { a = a . getSource ( ) . getFeatures ( ) ; for ( var b = 0 ; b < a . length ; b ++ ) this . snapFeatures . push ( a [ b ] ) } ; netgis . MapOpenLayers . prototype . removeSnapLayer = function ( a ) { a = a . getSource ( ) . getFeatures ( ) ; for ( var b = 0 ; b < a . length ; b ++ ) this . snapFeatures . remove ( a [ b ] ) } ; netgis . MapOpenLayers . prototype . onSnapOn = function ( a ) { this . setSnapOn ( ) } ;
netgis . MapOpenLayers . prototype . onSnapOff = function ( a ) { this . setSnapOff ( ) } ; netgis . MapOpenLayers . prototype . onLayerShow = function ( a ) { if ( a = this . layers [ a . id ] ) this . map . addLayer ( a ) , a instanceof ol . layer . Vector && this . addSnapLayer ( a ) } ; netgis . MapOpenLayers . prototype . onLayerHide = function ( a ) { if ( a = this . layers [ a . id ] ) this . map . removeLayer ( a ) , a instanceof ol . layer . Vector && this . removeSnapLayer ( a ) } ;
netgis . MapOpenLayers . prototype . onContextUpdate = function ( a ) { var b = a . bbox ; if ( b ) { var c = ol . proj . fromLonLat ( [ b [ 0 ] , b [ 1 ] ] , this . client . config . map . projection ) , d = ol . proj . fromLonLat ( [ b [ 2 ] , b [ 3 ] ] , this . client . config . map . projection ) ; b [ 0 ] = c [ 0 ] ; b [ 1 ] = c [ 1 ] ; b [ 2 ] = d [ 0 ] ; b [ 3 ] = d [ 1 ] ; this . view . fit ( b ) } for ( b = 0 ; b < a . layers . length ; b ++ ) if ( c = this . createLayer ( a . layers [ b ] ) ) c . setZIndex ( a . layers . length - b ) , this . layers [ b ] = c } ; netgis . MapOpenLayers . prototype . onSetMode = function ( a ) { this . setMode ( a ) } ;
netgis . MapOpenLayers . prototype . onSetExtent = function ( a ) { var b = ol . proj . fromLonLat ( [ a . minx , a . miny ] , this . client . config . map . projection ) ; a = ol . proj . fromLonLat ( [ a . maxx , a . maxy ] , this . client . config . map . projection ) ; this . view . fit ( [ b [ 0 ] , b [ 1 ] , a [ 0 ] , a [ 1 ] ] ) } ; netgis . MapOpenLayers . prototype . onChangeZoom = function ( a ) { this . view . animate ( { zoom : this . view . getZoom ( ) + a , duration : 200 } ) } ;
netgis . MapOpenLayers . prototype . onContextUpdate = function ( a ) { this . clearAll ( ) ; var b = a . bbox ; if ( b ) { if ( netgis . util . isDefined ( this . client . config . map ) && netgis . util . isDefined ( this . client . config . map . projection ) ) { var c = ol . proj . fromLonLat ( [ b [ 0 ] , b [ 1 ] ] , this . client . config . map . projection ) ; var d = ol . proj . fromLonLat ( [ b [ 2 ] , b [ 3 ] ] , this . client . config . map . projection ) } else c = ol . proj . fromLonLat ( [ b [ 0 ] , b [ 1 ] ] ) , d = ol . proj . fromLonLat ( [ b [ 2 ] , b [ 3 ] ] ) ; b [ 0 ] = c [ 0 ] ; b [ 1 ] = c [ 1 ] ; b [ 2 ] = d [ 0 ] ; b [ 3 ] = d [ 1 ] ; this . view . fit ( b ) } for ( b = 0 ; b < a . layers . length ; b ++ ) if ( c =
this . createLayer ( a . layers [ b ] ) ) c . setZIndex ( a . layers . length - b ) , this . layers [ b ] = c } ; netgis . MapOpenLayers . prototype . onSetMode = function ( a ) { this . setMode ( a ) } ; netgis . MapOpenLayers . prototype . onSetExtent = function ( a ) { var b = ol . proj . fromLonLat ( [ a . minx , a . miny ] , this . client . config . map . projection ) ; a = ol . proj . fromLonLat ( [ a . maxx , a . maxy ] , this . client . config . map . projection ) ; this . view . fit ( [ b [ 0 ] , b [ 1 ] , a [ 0 ] , a [ 1 ] ] ) } ; netgis . MapOpenLayers . prototype . onChangeZoom = function ( a ) { this . view . animate ( { zoom : this . view . getZoom ( ) + a , duration : 200 } ) } ;
netgis . MapOpenLayers . prototype . onZoomWKT = function ( a ) { a = ( new ol . format . WKT ) . readGeometry ( a ) ; this . view . fit ( a , { duration : 300 , padding : [ 40 , 40 , 40 , 40 ] } ) } ;
netgis . MapOpenLayers . prototype . onPointerMove = function ( a ) { var b = this . hover , c = this . styleSelect . bind ( this ) ; b && ( b . setStyle ( this . styleEdit . bind ( this ) ) , b = null ) ; var d = this ; switch ( this . mode ) { case netgis . Modes . DELETE _FEATURES : this . map . forEachFeatureAtPixel ( a . pixel , function ( a , f ) { f === d . editLayer && ( b = a , a . setStyle ( c ) ) ; return ! 0 } ) ; break ; case netgis . Modes . CUT _FEATURE _BEGIN : this . map . forEachFeatureAtPixel ( a . pixel , function ( a , f ) { f === d . editLayer && ( b = a , a . setStyle ( c ) ) ; return ! 0 } ) ; break ; case netgis . Modes . BUFFER _FEATURE _BEGIN : this . map . forEachFeatureAtPixel ( a . pixel ,
function ( a , f ) { f === d . editLayer && ( b = a , a . setStyle ( c ) ) ; return ! 0 } ) } this . hover = b } ;
netgis . MapOpenLayers . prototype . onSingleClick = function ( a ) { switch ( this . mode ) { case netgis . Modes . DELETE _FEATURES : this . hover && ( this . editLayer . getSource ( ) . removeFeature ( this . hover ) , this . hover = null ) ; break ; case netgis . Modes . CUT _FEATURE _BEGIN : this . hover && ( this . selected = this . hover , this . client . invoke ( netgis . Events . SET _MODE , netgis . Modes . CUT _FEATURE _DRAW ) ) ; break ; case netgis . Modes . BUFFER _FEATURE _BEGIN : this . hover && ( this . selected = this . hover , this . client . invoke ( netgis . Events . SET _MODE , netgis . Modes . BUFFER _FEATURE _EDIT ) ) } } ;
@ -85,25 +83,26 @@ netgis.MapOpenLayers.prototype.onShapeLoad=function(a){console.info("Shapefile T
netgis . MapOpenLayers . prototype . onImportGML = function ( a ) { var b = a . name , c = this , d = new FileReader ; d . onload = function ( a ) { c . createLayerGML ( b , a . target . result ) } ; d . readAsText ( a ) } ; netgis . MapOpenLayers . prototype . onImportShapefile = function ( a ) { var b = a . name , c = this , d = new FileReader ; d . onload = function ( a ) { c . createLayerShapefile ( b , a . target . result ) } ; d . readAsArrayBuffer ( a ) } ;
netgis . MapOpenLayers . prototype . createLayerGeoJSON = function ( a , b ) { a = new ol . format . GeoJSON ; a . readProjection ( b ) ; b = a . readFeatures ( b , { featureProjection : this . client . config . map . projection } ) ; this . addImportedFeatures ( b ) } ; netgis . MapOpenLayers . prototype . createLayerGML = function ( a , b ) { console . warn ( "GML support is experimental!" ) ; var c = new ol . format . WFS ; a = c . readProjection ( b ) ; b = c . readFeatures ( b , { featureProjection : this . client . config . map . projection } ) ; console . info ( "GML:" , a , b ) ; this . addImportedFeatures ( b ) } ;
netgis . MapOpenLayers . prototype . createLayerShapefile = function ( a , b ) { var c = this ; shp ( b ) . then ( function ( a ) { var b = new ol . format . GeoJSON ; b . readProjection ( a ) ; a = b . readFeatures ( a , { featureProjection : c . client . config . map . projection } ) ; c . addImportedFeatures ( a ) } ) } ; netgis . MapOpenLayers . prototype . addImportedFeatures = function ( a ) { this . editEventsSilent = ! 0 ; this . editLayer . getSource ( ) . addFeatures ( a ) ; this . editEventsSilent = ! 1 ; this . updateEditOutput ( ) } ;
netgis . MapOpenLayers . prototype . onExportPDF = function ( a ) { this . exportImage ( "pdf" , a . resx , a . resy , a . mode , a . margin ) } ; netgis . MapOpenLayers . prototype . onExportJPEG = function ( a ) { this . exportImage ( "jpeg" , a . resx , a . resy ) } ; netgis . MapOpenLayers . prototype . onExportPNG = function ( a ) { this . exportImage ( "png" , a . resx , a . resy ) } ; netgis . MapOpenLayers . prototype . onExportGIF = function ( a ) { this . exportImage ( "gif" , a . resx , a . resy ) } ; netgis . MapOpenLayers . prototype . getWidth = function ( ) { return this . map . getSize ( ) [ 0 ] } ;
netgis . MapOpenLayers . prototype . onImportWKT = function ( a ) { a = ( new ol . format . WKT ) . readGeometry ( a ) ; a = new ol . Feature ( { geometry : a } ) ; this . addImportedFeatures ( [ a ] ) } ; netgis . MapOpenLayers . prototype . onExportPDF = function ( a ) { this . exportImage ( "pdf" , a . resx , a . resy , a . mode , a . margin ) } ; netgis . MapOpenLayers . prototype . onExportJPEG = function ( a ) { this . exportImage ( "jpeg" , a . resx , a . resy ) } ; netgis . MapOpenLayers . prototype . onExportPNG = function ( a ) { this . exportImage ( "png" , a . resx , a . resy ) } ;
netgis . MapOpenLayers . prototype . onExportGIF = function ( a ) { this . exportImage ( "gif" , a . resx , a . resy ) } ; netgis . MapOpenLayers . prototype . onParcelShowPreview = function ( a ) { a = ( new ol . format . WKT ) . readGeometry ( a . geom ) ; a = new ol . Feature ( { geometry : a } ) ; this . parcelLayer . getSource ( ) . clear ( ) ; this . parcelLayer . getSource ( ) . addFeature ( a ) } ; netgis . MapOpenLayers . prototype . onParcelHidePreview = function ( a ) { this . parcelLayer . getSource ( ) . clear ( ) } ; netgis . MapOpenLayers . prototype . getWidth = function ( ) { return this . map . getSize ( ) [ 0 ] } ;
netgis . MapOpenLayers . prototype . getHeight = function ( ) { return this . map . getSize ( ) [ 1 ] } ;
netgis . MapOpenLayers . prototype . exportImage = function ( a , b , c , d , e ) { this . client . invoke ( netgis . Events . EXPORT _BEGIN , null ) ; var f = this , g = this . root , h = this . map , k = this . client . config , m= new Image ; m . onload = function ( ) { var l = document . createElement ( "div" ) ; l. style . position = "fixed" ; l . style . top = "0px" ; l . style . left = "0px" ; l . style . width = b + "px" ; l . style . height = c + "px" ; l. style . background = "white" ; l . style . zIndex = - 1 ; l . style . opacity = 0 ; l . style . pointerEvents = "none" ; g . appendChild ( l) ; h . setTarget ( l ) ; h . once ( "rendercomplete" , function ( ) { var n =
document . createElement ( "canvas" ) ; n . width = b ; n . height = c ; var p= n . getContext ( "2d" ) ; p . webkitImageSmoothingEnabled = ! 1 ; p . mozImageSmoothingEnabled = ! 1 ; p . imageSmoothingEnabled = ! 1 ; Array . prototype . forEach . call ( document . querySelectorAll ( ".ol-layer canvas" ) , function ( a ) { if ( 0 < a . width ) { var b = a . parentNode . style . opacity ; p . globalAlpha = "" === b ? 1 : Number ( b ) ; b = a . style . transform . match ( /^matrix\(([^\(]*)\)$/ ) [ 1 ] . split ( "," ) . map ( Number ) ; CanvasRenderingContext2D . prototype . setTransform . apply ( p, b ) ; p . drawImage ( a , 0 , 0 ) } } ) ; p. drawImage ( m ,
0 , 0 ) ; var u = document . createElement ( "a" ) ; switch ( a ) { case "pdf" : e = e ? e : 0 ; var q= 297 - e - e , r = 210 - e - e , v = n . width / n . height ; if ( ! d ) { var t= q ; q = r ; r = t } if ( n . height > n . width ) { var w= r ; t = w * v ; t > q && ( t = q , w = t / v ) } else t = q , w = t / v , w > r && ( w = r , t = w * v ) ; v = new jsPDF ( d ? "l" : "p" ) ; var x = e ; x += ( q- t ) / 2 ; q = e ; q += ( r - w ) / 2 ; v . addImage ( n . toDataURL ( "image/png,1.0" , 1 ) , "PNG" , x , q, t , w ) ; v . setFontSize ( 8 ) ; v . text ( "Quelle: " + window . location . href , x + 2 , q+ w - 2 ) ; n = v . output ( "bloburl" , { filename : k . export . defaultFilename + ".pdf" } ) ; window . open ( n , "_blank" ) ; break ; case "jpeg" : window . navigator . msSaveBlob ?
window . navigator . msSaveBlob ( n . msToBlob ( ) , k . export . defaultFilename + ".jpg" ) : ( u . setAttribute ( "download" , k . export . defaultFilename + ".jpg" ) , u . setAttribute ( "href" , n . toDataURL ( "image/jpeg" , 1 ) ) , u . click ( ) ) ; break ; case "png" : window . navigator . msSaveBlob ? window . navigator . msSaveBlob ( n . msToBlob ( ) , k . export . defaultFilename + ".png" ) : ( u . setAttribute ( "download" , k . export . defaultFilename + ".png" ) , u . setAttribute ( "href" , n . toDataURL ( "image/png" , 1 ) ) , u . click ( ) ) ; break ; case "gif" : u . setAttribute ( "download" , k . export . defaultFilename +
".gif" ) , r = new GIF ( { workerScript : k . export . gifWebWorker , quality : 1 } ) , r. addFrame ( n ) , r . on ( "finished" , function ( a ) { u . setAttribute ( "href" , window . URL . createObjectURL ( a ) ) ; u. click ( ) } ) , r . render ( ) } h . setTarget ( g ) ; g . removeChild ( l ) ; f . client . invoke ( netgis . Events . EXPORT _END , null ) } ) ; h . renderSync ( ) } ; m . src = k . export . logo } ;
netgis . MapOpenLayers . prototype . exportImage = function ( a , b , c , d , e ) { this . client . invoke ( netgis . Events . EXPORT _BEGIN , null ) ; var f = this , g = this . root , h = this . map , k = this . client . config , l= new Image ; l . onload = function ( ) { var m = document . createElement ( "div" ) ; m. style . position = "fixed" ; m . style . top = "0px" ; m . style . left = "0px" ; m . style . width = b + "px" ; m . style . height = c + "px" ; m. style . background = "white" ; m . style . zIndex = - 1 ; m . style . opacity = 0 ; m . style . pointerEvents = "none" ; g . appendChild ( m) ; h . setTarget ( m ) ; h . once ( "rendercomplete" , function ( ) { var n =
document . createElement ( "canvas" ) ; n . width = b ; n . height = c ; var w= n . getContext ( "2d" ) ; w . webkitImageSmoothingEnabled = ! 1 ; w . mozImageSmoothingEnabled = ! 1 ; w . imageSmoothingEnabled = ! 1 ; Array . prototype . forEach . call ( document . querySelectorAll ( ".ol-layer canvas" ) , function ( a ) { if ( 0 < a . width ) { var b = a . parentNode . style . opacity ; w . globalAlpha = "" === b ? 1 : Number ( b ) ; b = a . style . transform . match ( /^matrix\(([^\(]*)\)$/ ) [ 1 ] . split ( "," ) . map ( Number ) ; CanvasRenderingContext2D . prototype . setTransform . apply ( w, b ) ; w . drawImage ( a , 0 , 0 ) } } ) ; w. drawImage ( l ,
0 , 0 ) ; var t = document . createElement ( "a" ) ; switch ( a ) { case "pdf" : e = e ? e : 0 ; var p= 297 - e - e , q = 210 - e - e , u = n . width / n . height ; if ( ! d ) { var r= p ; p = q ; q = r } if ( n . height > n . width ) { var v= q ; r = v * u ; r > p && ( r = p , v = r / u ) } else r = p , v = r / u , v > q && ( v = q , r = v * u ) ; u = new jsPDF ( d ? "l" : "p" ) ; var x = e ; x += ( p- r ) / 2 ; p = e ; p += ( q - v ) / 2 ; u . addImage ( n . toDataURL ( "image/png,1.0" , 1 ) , "PNG" , x , p, r , v ) ; u . setFontSize ( 8 ) ; u . text ( "Quelle: " + window . location . href , x + 2 , p+ v - 2 ) ; n = u . output ( "bloburl" , { filename : k . export . defaultFilename + ".pdf" } ) ; window . open ( n , "_blank" ) ; break ; case "jpeg" : window . navigator . msSaveBlob ?
window . navigator . msSaveBlob ( n . msToBlob ( ) , k . export . defaultFilename + ".jpg" ) : ( t . setAttribute ( "download" , k . export . defaultFilename + ".jpg" ) , t . setAttribute ( "href" , n . toDataURL ( "image/jpeg" , 1 ) ) , t . click ( ) ) ; break ; case "png" : window . navigator . msSaveBlob ? window . navigator . msSaveBlob ( n . msToBlob ( ) , k . export . defaultFilename + ".png" ) : ( t . setAttribute ( "download" , k . export . defaultFilename + ".png" ) , t . setAttribute ( "href" , n . toDataURL ( "image/png" , 1 ) ) , t . click ( ) ) ; break ; case "gif" : t . setAttribute ( "download" , k . export . defaultFilename +
".gif" ) , q = new GIF ( { workerScript : k . export . gifWebWorker , quality : 1 } ) , q. addFrame ( n ) , q . on ( "finished" , function ( a ) { t . setAttribute ( "href" , window . URL . createObjectURL ( a ) ) ; t. click ( ) } ) , q . render ( ) } h . setTarget ( g ) ; g . removeChild ( m ) ; f . client . invoke ( netgis . Events . EXPORT _END , null ) } ) ; h . renderSync ( ) } ; l . src = k . export . logo } ;
netgis . MapOpenLayers . prototype . splitMultiPolygons = function ( a ) { a = a . getSource ( ) ; for ( var b = a . getFeatures ( ) , c = [ ] , d = [ ] , e = 0 ; e < b . length ; e ++ ) { var f = b [ e ] , g = f . getGeometry ( ) ; if ( g instanceof ol . geom . MultiPolygon ) { g = g . getPolygons ( ) ; for ( var h = 0 ; h < g . length ; h ++ ) { var k = new ol . Feature ( { geometry : g [ h ] } ) ; d . push ( k ) } c . push ( f ) } } for ( e = 0 ; e < c . length ; e ++ ) a . removeFeature ( c [ e ] ) ; a . addFeatures ( d ) } ; netgis = netgis || { } ; netgis . Menu = function ( ) { this . root = this . client = null ; this . sections = [ ] } ;
netgis . Menu . prototype . load = function ( ) { this . root = document . createElement ( "header" ) ; this . root . className = "netgis-menu netgis-primary netgis-shadow" ; var a = document . createElement ( "div" ) ; this . root . appendChild ( a ) ; var b = this . createButton ( 'Ebenen<i class="fab fa-buffer"></i>' , ! 0 ) ; b . addEventListener ( "click" , this . onToggleClick . bind ( this ) ) ; a . appendChild ( b ) ; b = this . createButton ( 'Suche<i class="fas fa-search" style="position: relative; top: 0.3mm;"></i>' , ! 0 ) ; b . addEventListener ( "click" , this . onSearchPlaceClick . bind ( this ) ) ;
a . appendChild ( b ) ; if ( this . client . editable ) { b = this . createMenu ( '<i class="fas fa-caret-down"></i>Zeichnen' ) ; var c = b . getElementsByTagName ( "ul" ) [ 0 ] ; a . appendChild ( b ) ; c . appendChild ( this . createMenuItem ( '<i class="fas fa-map-marker-alt"></i>Punkte' , this . onDrawPointClick . bind ( this ) ) ) ; c . appendChild ( this . createMenuItem ( '<i class="fas fa-minus"></i>Linien' , this . onDrawLineClick . bind ( this ) ) ) ; c . appendChild ( this . createMenuItem ( '<i class="fas fa-vector-square"></i>Polygone' , this . onDrawPolygonClick . bind ( this ) ) ) ; b = this . createMenu ( '<i class="fas fa-caret-down"></i>Bearbeiten' ) ;
c = b . getElementsByTagName ( "ul" ) [ 0 ] ; a . appendChild ( b ) ; c . appendChild ( this . createMenuItem ( '<i class="fas fa-cut"></i>Ausschneiden' , this . onCutFeatureClick . bind ( this ) ) ) ; c . appendChild ( this . createMenuItem ( '<i class="fas fa-arrows-alt"></i>Verschieben' , this . onModifyFeaturesClick . bind ( this ) ) ) ; c . appendChild ( this . createMenuItem ( '<i class="fas fa-eraser"></i>L\u00f6schen' , this . onDeleteFeaturesClick . bind ( this ) ) ) ; c . appendChild ( this . createMenuItem ( '<i class="far fa-dot-circle"></i>Puffern' , this . onBufferFeatureClick . bind ( this ) ) ) ;
b = this . createMenu ( '<i class="fas fa-caret-down"></i>Import' ) ; a . appendChild ( b ) ; b = b . getElementsByTagName ( "ul" ) [ 0 ] ; b . appendChild ( this . createMenuItem ( '<i class="fas fa-file"></i>GeoJSON' , this . onImportGeoJSONClick . bind ( this ) ) ) ; b . appendChild ( this . createMenuItem ( '<i class="fas fa-file"></i>GML' , this . onImportGMLClick . bind ( this ) ) ) ; b . appendChild ( this . createMenuItem ( '<i class="fas fa-file"></i>Shapefile' , this . onImportShapefileClick . bind ( this ) ) ) ; b = this . createMenu ( '<i class="fas fa-caret-down"></i>Export' ) ; a . appendChild ( b ) ;
a = b . getElementsByTagName ( "ul" ) [ 0 ] ; a . appendChild ( this . createMenuItem ( '<i class="fas fa-file"></i>PDF' , this . onExportPDFClick . bind ( this ) ) ) ; a . appendChild ( this . createMenuItem ( '<i class="fas fa-file"></i>JPEG' , this . onExportJPEGClick . bind ( this ) ) ) ; a . appendChild ( this . createMenuItem ( '<i class="fas fa-file"></i>PNG' , this . onExportPNGClick . bind ( this ) ) ) ; a . appendChild ( this . createMenuItem ( '<i class="fas fa-file"></i>GIF' , this . onExportGIFClick . bind ( this ) ) ) } this . client . root . appendChild ( this . root ) } ;
netgis . Menu . prototype . createButton = function ( a , b ) { var c = document . createElement ( "button" ) ; c . setAttribute ( "type" , "button" ) ; c . className = "netgis-primary netgis-hover-primary" ; b && ( c . className += " netgis-right" ) ; c . innerHTML = a ; return c } ;
a . appendChild ( b ) ; b = this . createButton ( 'Flurst\u00fccke<i class="fas fa-vector-square" style="position: relative; top: 0.3mm;"></i>' , ! 0 ) ; b . addEventListener ( "click" , this . onSearchParcelClick . bind ( this ) ) ; a . appendChild ( b ) ; if ( this . client . editable ) { b = this . createMenu ( '<i class="fas fa-caret-down"></i>Zeichnen' ) ; var c = b . getElementsByTagName ( "ul" ) [ 0 ] ; a . appendChild ( b ) ; c . appendChild ( this . createMenuItem ( '<i class="fas fa-map-marker-alt"></i>Punkte' , this . onDrawPointClick . bind ( this ) ) ) ; c . appendChild ( this . createMenuItem ( '<i class="fas fa-minus"></i>Linien' ,
this . onDrawLineClick . bind ( this ) ) ) ; c . appendChild ( this . createMenuItem ( '<i class="fas fa-vector-square"></i>Polygone' , this . onDrawPolygonClick . bind ( this ) ) ) ; b = this . createMenu ( '<i class="fas fa-caret-down"></i>Bearbeiten' ) ; c = b . getElementsByTagName ( "ul" ) [ 0 ] ; a . appendChild ( b ) ; c . appendChild ( this . createMenuItem ( '<i class="fas fa-cut"></i>Ausschneiden' , this . onCutFeatureClick . bind ( this ) ) ) ; c . appendChild ( this . createMenuItem ( '<i class="fas fa-arrows-alt"></i>Verschieben' , this . onModifyFeaturesClick . bind ( this ) ) ) ; c . appendChild ( this . createMenuItem ( '<i class="fas fa-eraser"></i>L\u00f6schen' ,
this . onDeleteFeaturesClick . bind ( this ) ) ) ; c . appendChild ( this . createMenuItem ( '<i class="far fa-dot-circle"></i>Puffern' , this . onBufferFeatureClick . bind ( this ) ) ) ; b = this . createMenu ( '<i class="fas fa-caret-down"></i>Import' ) ; a . appendChild ( b ) ; b = b . getElementsByTagName ( "ul" ) [ 0 ] ; b . appendChild ( this . createMenuItem ( '<i class="fas fa-file"></i>GeoJSON' , this . onImportGeoJSONClick . bind ( this ) ) ) ; b . appendChild ( this . createMenuItem ( '<i class="fas fa-file"></i>GML' , this . onImportGMLClick . bind ( this ) ) ) ; b . appendChild ( this . createMenuItem ( '<i class="fas fa-file"></i>Shapefile' ,
this . onImportShapefileClick . bind ( this ) ) ) ; b = this . createMenu ( '<i class="fas fa-caret-down"></i>Export' ) ; a . appendChild ( b ) ; a = b . getElementsByTagName ( "ul" ) [ 0 ] ; a . appendChild ( this . createMenuItem ( '<i class="fas fa-file"></i>PDF' , this . onExportPDFClick . bind ( this ) ) ) ; a . appendChild ( this . createMenuItem ( '<i class="fas fa-file"></i>JPEG' , this . onExportJPEGClick . bind ( this ) ) ) ; a . appendChild ( this . createMenuItem ( '<i class="fas fa-file"></i>PNG' , this . onExportPNGClick . bind ( this ) ) ) ; a . appendChild ( this . createMenuItem ( '<i class="fas fa-file"></i>GIF' ,
this . onExportGIFClick . bind ( this ) ) ) } this . client . root . appendChild ( this . root ) } ; netgis . Menu . prototype . createButton = function ( a , b ) { var c = document . createElement ( "button" ) ; c . setAttribute ( "type" , "button" ) ; c . className = "netgis-primary netgis-hover-primary" ; b && ( c . className += " netgis-right" ) ; c . innerHTML = a ; return c } ;
netgis . Menu . prototype . createMenu = function ( a ) { var b = document . createElement ( "div" ) ; b . className = "netgis-dropdown" ; var c = document . createElement ( "button" ) ; c . setAttribute ( "type" , "button" ) ; c . className = "netgis-primary netgis-hover-primary" ; c . innerHTML = a ; b . appendChild ( c ) ; a = document . createElement ( "ul" ) ; a . className = "netgis-dropdown-content netgis-dialog netgis-shadow" ; b . appendChild ( a ) ; return b } ;
netgis . Menu . prototype . createMenuItem = function ( a , b ) { var c = document . createElement ( "li" ) ; c . className = "netgis-hover-light" ; var d = document . createElement ( "button" ) ; d . setAttribute ( "type" , "button" ) ; d . innerHTML = a ; d . addEventListener ( "click" , b ) ; c . appendChild ( d ) ; return c } ; netgis . Menu . prototype . onToggleClick = function ( a ) { this . client . invoke ( netgis . Events . LAYER _LIST _TOGGLE , null ) } ; netgis . Menu . prototype . onDrawPointClick = function ( a ) { this . client . invoke ( netgis . Events . SET _MODE , netgis . Modes . DRAW _POINTS ) } ;
netgis . Menu . prototype . onDrawLineClick = function ( a ) { this . client . invoke ( netgis . Events . SET _MODE , netgis . Modes . DRAW _LINES ) } ; netgis . Menu . prototype . onDrawPolygonClick = function ( a ) { this . client . invoke ( netgis . Events . SET _MODE , netgis . Modes . DRAW _POLYGONS ) } ; netgis . Menu . prototype . onCutFeatureClick = function ( a ) { this . client . invoke ( netgis . Events . SET _MODE , netgis . Modes . CUT _FEATURE _BEGIN ) } ; netgis . Menu . prototype . onModifyFeaturesClick = function ( a ) { this . client . invoke ( netgis . Events . SET _MODE , netgis . Modes . MODIFY _FEATURES ) } ;
netgis . Menu . prototype . onDeleteFeaturesClick = function ( a ) { this . client . invoke ( netgis . Events . SET _MODE , netgis . Modes . DELETE _FEATURES ) } ; netgis . Menu . prototype . onBufferFeatureClick = function ( a ) { this . client . invoke ( netgis . Events . SET _MODE , netgis . Modes . BUFFER _FEATURE _BEGIN ) } ; netgis . Menu . prototype . onSearchPlaceClick = function ( a ) { this . client . invoke ( netgis . Events . SET _MODE , netgis . Modes . SEARCH _PLACE ) } ; netgis . Menu . prototype . onSearch DataClick= function ( a ) { alert ( "TODO: data search interface" ) } ;
netgis . Menu . prototype . onImportOWSClick = function ( a ) { alert ( "TODO: ows import interface, try setting url parameter '?ows=<url>'" ) } ; netgis . Menu . prototype . onImportShapefileClick = function ( a ) { this . client . invoke ( netgis . Events . IMPORT _SHAPEFILE _SHOW , null ) } ; netgis . Menu . prototype . onImportGeoJSONClick = function ( a ) { this . client . invoke ( netgis . Events . IMPORT _GEOJSON _SHOW , null ) } ; netgis . Menu . prototype . onImportKMLClick = function ( a ) { alert ( "TODO: kml import interface" ) } ;
netgis . Menu . prototype . onDeleteFeaturesClick = function ( a ) { this . client . invoke ( netgis . Events . SET _MODE , netgis . Modes . DELETE _FEATURES ) } ; netgis . Menu . prototype . onBufferFeatureClick = function ( a ) { this . client . invoke ( netgis . Events . SET _MODE , netgis . Modes . BUFFER _FEATURE _BEGIN ) } ; netgis . Menu . prototype . onSearchPlaceClick = function ( a ) { this . client . invoke ( netgis . Events . SET _MODE , netgis . Modes . SEARCH _PLACE ) } ; netgis . Menu . prototype . onSearch ParcelClick= function ( a ) { this . client . invoke ( netgis . Events . SET _MODE , netgis . Modes . SEARCH _PARCEL ) } ;
netgis . Menu . prototype . onSearchDataClick = function ( a ) { alert ( "TODO: data search interface" ) } ; netgis . Menu . prototype . onImportOWSClick = function ( a ) { alert ( "TODO: ows import interface, try setting url parameter '?ows=<url>'" ) } ; netgis . Menu . prototype . onImportShapefileClick = function ( a ) { this . client . invoke ( netgis . Events . IMPORT _SHAPEFILE _SHOW , null ) } ; netgis . Menu . prototype . onImportGeoJSONClick = function ( a ) { this . client . invoke ( netgis . Events . IMPORT _GEOJSON _SHOW , null ) } ; netgis . Menu . prototype . onImportKMLClick = function ( a ) { alert ( "TODO: kml import interface" ) } ;
netgis . Menu . prototype . onImportGMLClick = function ( a ) { this . client . invoke ( netgis . Events . IMPORT _GML _SHOW , null ) } ; netgis . Menu . prototype . onExportPDFClick = function ( a ) { this . client . invoke ( netgis . Events . EXPORT _PDF _SHOW , null ) } ; netgis . Menu . prototype . onExportJPEGClick = function ( a ) { this . client . invoke ( netgis . Events . EXPORT _JPEG _SHOW , null ) } ; netgis . Menu . prototype . onExportPNGClick = function ( a ) { this . client . invoke ( netgis . Events . EXPORT _PNG _SHOW , null ) } ;
netgis . Menu . prototype . onExportGIFClick = function ( a ) { this . client . invoke ( netgis . Events . EXPORT _GIF _SHOW , null ) } ; netgis = netgis || { } ; netgis . Modal = function ( ) { this . exportGIF = this . exportPNG = this . exportJPEG = this . exportPDF = this . importShapefile = this . importGML = this . importGeoJSON = this . client = null } ;
netgis . Modal . prototype . load = function ( ) { this . root = document . createElement ( "section" ) ; this . root . className = "netgis-modal" ; this . root . addEventListener ( "click" , this . onRootClick . bind ( this ) ) ; this . importGeoJSON = this . createImportGeoJSON ( ) ; this . root . appendChild ( this . importGeoJSON ) ; this . importGML = this . createImportGML ( ) ; this . root . appendChild ( this . importGML ) ; this . importShapefile = this . createImportShapefile ( ) ; this . root . appendChild ( this . importShapefile ) ; this . exportPDF = this . createExportPDF ( ) ; this . root . appendChild ( this . exportPDF ) ;
@ -135,22 +134,47 @@ netgis.Modal.prototype.onImportShapefileAccept=function(a){a=this.importShapefil
netgis . Modal . prototype . onExportJPEGShow = function ( a ) { a = this . exportJPEG . getElementsByTagName ( "input" ) ; a [ 0 ] . value = this . client . map . getWidth ( ) ; a [ 1 ] . value = this . client . map . getHeight ( ) ; this . show ( this . exportJPEG ) } ; netgis . Modal . prototype . onExportPNGShow = function ( a ) { a = this . exportPNG . getElementsByTagName ( "input" ) ; a [ 0 ] . value = this . client . map . getWidth ( ) ; a [ 1 ] . value = this . client . map . getHeight ( ) ; this . show ( this . exportPNG ) } ;
netgis . Modal . prototype . onExportGIFShow = function ( a ) { a = this . exportGIF . getElementsByTagName ( "input" ) ; a [ 0 ] . value = this . client . map . getWidth ( ) ; a [ 1 ] . value = this . client . map . getHeight ( ) ; this . show ( this . exportGIF ) } ; netgis . Modal . prototype . onExportPDFAccept = function ( a ) { a = this . exportPDF . getElementsByTagName ( "input" ) ; var b = Number . parseInt ( a [ 0 ] . value ) , c = Number . parseInt ( a [ 1 ] . value ) , d = Number . parseInt ( a [ 2 ] . value ) ; this . client . invoke ( netgis . Events . EXPORT _PDF , { resx : b , resy : c , mode : a [ 3 ] . checked , margin : d } ) ; this . hide ( ) } ;
netgis . Modal . prototype . onExportJPEGAccept = function ( a ) { var b = this . exportJPEG . getElementsByTagName ( "input" ) ; a = Number . parseInt ( b [ 0 ] . value ) ; b = Number . parseInt ( b [ 1 ] . value ) ; this . client . invoke ( netgis . Events . EXPORT _JPEG , { resx : a , resy : b } ) ; this . hide ( ) } ; netgis . Modal . prototype . onExportPNGAccept = function ( a ) { var b = this . exportPNG . getElementsByTagName ( "input" ) ; a = Number . parseInt ( b [ 0 ] . value ) ; b = Number . parseInt ( b [ 1 ] . value ) ; this . client . invoke ( netgis . Events . EXPORT _PNG , { resx : a , resy : b } ) ; this . hide ( ) } ;
netgis . Modal . prototype . onExportGIFAccept = function ( a ) { var b = this . exportGIF . getElementsByTagName ( "input" ) ; a = Number . parseInt ( b [ 0 ] . value ) ; b = Number . parseInt ( b [ 1 ] . value ) ; this . client . invoke ( netgis . Events . EXPORT _GIF , { resx : a , resy : b } ) ; this . hide ( ) } ; netgis = netgis || { } ; netgis . Modes = Object . freeze ( { VIEW : "VIEW" , PANNING : "PANNING" , ZOOMING _IN : "ZOOMING_IN" , ZOOMING _OUT : "ZOOMING_OUT" , DRAW _POINTS : "DRAW_POINTS" , DRAW _LINES : "DRAW_LINES" , DRAW _POLYGONS : "DRAW_POLYGONS" , CUT _FEATURE _BEGIN : "CUT_FEATURE_BEGIN" , CUT _FEATURE _DRAW : "CUT_FEATURE_DRAW" , MODIFY _FEATURES : "MODIFY_FEATURES" , DELETE _FEATURES : "DELETE_FEATURES" , BUFFER _FEATURE _BEGIN : "BUFFER_FEATURE_BEGIN" , BUFFER _FEATURE _EDIT : "BUFFER_FEATURE_EDIT" , SEARCH _PLACE : "SEARCH_PLACE" } ) ; netgis = netgis || { } ; netgis . Module = function ( ) { this . client = null } ; netgis . Module . prototype . load = function ( ) { } ; netgis = netgis || { } ; netgis . OWS = function ( ) { return { read : function ( a , b ) { var c = a . properties . bbox ; b . invoke ( netgis . Events . MAP _SET _EXTENT , { minx : c [ 0 ] , miny : c [ 1 ] , maxx : c [ 2 ] , maxy : c [ 3 ] } ) ; a = a . features ; for ( b = 0 ; b < a . length ; b ++ ) ; } } } ( ) ; netgis = netgis || { } ; netgis . SearchPlace = function ( ) { this . lastRequest = this . timeout = this . client = null } ; netgis . SearchPlace . prototype . load = function ( ) { this . client . on ( netgis . Events . SEARCH _PLACE _REQUEST , this . onSearchPlaceRequest . bind ( this ) ) } ; netgis . SearchPlace . prototype . request = function ( a ) { var b = this . client . config . search . url ; a = a . trim ( ) ; b = netgis . util . replace ( b , "{q}" , window . encodeURIComponent ( a ) ) ; b = netgis . util . replace ( b , "{epsg}" , 4326 ) ; b = window . encodeURI ( b ) ; this . lastRequest = netgis . util . request ( b , this . onSearchPlaceResponse . bind ( this ) ) } ;
netgis . Modal . prototype . onExportGIFAccept = function ( a ) { var b = this . exportGIF . getElementsByTagName ( "input" ) ; a = Number . parseInt ( b [ 0 ] . value ) ; b = Number . parseInt ( b [ 1 ] . value ) ; this . client . invoke ( netgis . Events . EXPORT _GIF , { resx : a , resy : b } ) ; this . hide ( ) } ; netgis = netgis || { } ; netgis . Modes = Object . freeze ( { VIEW : "VIEW" , PANNING : "PANNING" , ZOOMING _IN : "ZOOMING_IN" , ZOOMING _OUT : "ZOOMING_OUT" , DRAW _POINTS : "DRAW_POINTS" , DRAW _LINES : "DRAW_LINES" , DRAW _POLYGONS : "DRAW_POLYGONS" , CUT _FEATURE _BEGIN : "CUT_FEATURE_BEGIN" , CUT _FEATURE _DRAW : "CUT_FEATURE_DRAW" , MODIFY _FEATURES : "MODIFY_FEATURES" , DELETE _FEATURES : "DELETE_FEATURES" , BUFFER _FEATURE _BEGIN : "BUFFER_FEATURE_BEGIN" , BUFFER _FEATURE _EDIT : "BUFFER_FEATURE_EDIT" , SEARCH _PLACE : "SEARCH_PLACE" , SEARCH _PARCEL : "SEARCH_PARCEL" } ) ; netgis = netgis || { } ;
netgis . OWS = function ( ) { return { read : function ( a , b ) { var c = { layers : [ ] , folders : [ ] } ; netgis . util . isDefined ( a . properties ) && ( c . bbox = a . properties . bbox ) ; a = a . features ; for ( var d = 0 ; d < a . length ; d ++ ) { var e = a [ d ] ; if ( "Feature" === e . type ) { var f = e . properties ; f = f . folder ; var g = ! 1 ; for ( e = 0 ; e < c . folders . length ; e ++ ) if ( c . folders [ e ] . id === f ) { g = ! 0 ; break } if ( ! g ) { e = f . split ( "/" ) ; f = [ ] ; for ( g = 0 ; g < e . length ; g ++ ) { var h = e [ g ] ; 0 < h . length && f . push ( h ) } var k = - 1 ; for ( g = 0 ; g < f . length ; g ++ ) { h = f [ g ] ; var l = "/" + f . slice ( 0 , g + 1 ) . join ( "/" ) , m = ! 1 ; for ( e = 0 ; e < c . folders . length ; e ++ ) if ( c . folders [ e ] . path ===
l ) { k = e ; m = ! 0 ; break } m || ( e = c . folders . length , c . folders . push ( { title : h , parent : k , path : l } ) , k = e ) } } } } for ( d = 0 ; d < a . length ; d ++ ) if ( e = a [ d ] , "Feature" === e . type ) { f = e . properties ; g = - 1 ; for ( e = 0 ; e < c . folders . length ; e ++ ) if ( c . folders [ e ] . path === f . folder ) { g = e ; break } e = f . offerings ; for ( h = 0 ; h < e . length ; h ++ ) switch ( k = e [ h ] , l = k . operations , k . code ) { case "http://www.opengis.net/spec/owc-geojson/1.0/req/wms" : c . layers . push ( { folder : g , type : netgis . LayerTypes . WMS , url : l [ 0 ] . href , title : f . title , attribution : f . rights , active : f . active } ) ; break ; case "http://www.opengis.net/spec/owc-geojson/1.0/req/xyz" : k =
l [ 0 ] ; c . layers . push ( { folder : g , type : netgis . LayerTypes . XYZ , url : k . href , title : f . title , attribution : f . rights , active : f . active } ) ; break ; case "http://www.opengis.net/spec/owc-geojson/1.0/req/osm" : k = l [ 0 ] , c . layers . push ( { folder : g , type : netgis . LayerTypes . XYZ , url : k . href , title : f . title , attribution : f . rights , active : f . active } ) } } b . invoke ( netgis . Events . CONTEXT _UPDATE , c ) } } } ( ) ; netgis = netgis || { } ; netgis . SearchParcel = function ( ) { this . client = null } ;
netgis . SearchParcel . prototype . load = function ( ) { this . root = document . createElement ( "section" ) ; this . root . className = "netgis-search-parcel netgis-dialog netgis-shadow netgis-hide" ; var a = document . createElement ( "h3" ) ; a . innerHTML = "Flurst\u00fccks-Suche:" ; this . root . appendChild ( a ) ; a = document . createElement ( "div" ) ; this . root . appendChild ( a ) ; var b = this . createInput ( "Gemarkungsname:" ) ; b . style . position = "relative" ; a . appendChild ( b ) ; this . nameInput = b . children [ 0 ] ; this . nameInput . setAttribute ( "title" , "ENTER: Ausw\u00e4hlen, ESCAPE: Zur\u00fccksetzen" ) ;
this . nameInput . addEventListener ( "keyup" , this . onInputNameKey . bind ( this ) ) ; this . nameLoader = document . createElement ( "div" ) ; this . nameLoader . className = "netgis-loader netgis-text-primary netgis-hide" ; this . nameLoader . innerHTML = "<i class='fas fa-spinner'></i>" ; b . appendChild ( this . nameLoader ) ; this . nameList = document . createElement ( "ul" ) ; a . appendChild ( this . nameList ) ; b = this . createInput ( "Gemarkungsnummer:" ) ; this . districtInput = b . children [ 0 ] ; a . appendChild ( b ) ; b = this . createInput ( "Flurnummer:" ) ; this . fieldInput = b . children [ 0 ] ;
a . appendChild ( b ) ; b = this . createInput ( "Flurst\u00fccksnummer (Z\u00e4hler/Nenner):" ) ; this . parcelInputA = b . children [ 0 ] ; this . parcelInputA . style . width = "48%" ; this . parcelInputB = this . parcelInputA . cloneNode ( ! 0 ) ; this . parcelInputB . style . marginLeft = "4%" ; b . appendChild ( this . parcelInputB ) ; a . appendChild ( b ) ; b = document . createElement ( "button" ) ; b . setAttribute ( "type" , "button" ) ; b . addEventListener ( "click" , this . onParcelSearchClick . bind ( this ) ) ; b . className = "netgis-primary netgis-hover-primary" ; b . innerHTML = "Flurst\u00fccke suchen" ;
b . style . marginTop = "4mm" ; a . appendChild ( b ) ; this . parcelInfo = document . createElement ( "p" ) ; a . appendChild ( this . parcelInfo ) ; this . parcelTable = this . createTable ( ";Flur;FS Z\u00e4hler;FS Nenner;FKZ;Fl\u00e4che (qm)" . split ( ";" ) ) ; this . parcelTable . classList . add ( "netgis-hide" ) ; a . appendChild ( this . parcelTable ) ; this . parcelList = this . parcelTable . getElementsByTagName ( "tbody" ) [ 0 ] ; this . parcelReset = document . createElement ( "button" ) ; this . parcelReset . setAttribute ( "type" , "button" ) ; this . parcelReset . addEventListener ( "click" , this . onParcelResetClick . bind ( this ) ) ;
this . parcelReset . className = "netgis-primary netgis-hover-primary" ; this . parcelReset . innerHTML = "Zur\u00fccksetzen" ; this . parcelReset . style . marginTop = "4mm" ; a . appendChild ( this . parcelReset ) ; this . reset ( ) ; this . client . root . appendChild ( this . root ) ; this . client . on ( netgis . Events . SET _MODE , this . onSetMode . bind ( this ) ) ; this . client . on ( netgis . Events . LAYER _LIST _TOGGLE , this . onLayerListToggle . bind ( this ) ) } ;
netgis . SearchParcel . prototype . createInput = function ( a ) { var b = document . createElement ( "label" ) ; b . className = "netgis-hover-text-primary" ; b . innerHTML = a ; a = document . createElement ( "input" ) ; a . setAttribute ( "type" , "text" ) ; b . appendChild ( a ) ; return b } ;
netgis . SearchParcel . prototype . createNameItem = function ( a ) { var b = document . createElement ( "li" ) , c = document . createElement ( "button" ) ; c . setAttribute ( "type" , "button" ) ; c . addEventListener ( "click" , this . onNameItemClick . bind ( this ) ) ; c . className = "netgis-text-primary netgis-hover-light" ; c . innerHTML = a ; b . appendChild ( c ) ; return b } ;
netgis . SearchParcel . prototype . createTable = function ( a ) { var b = document . createElement ( "div" ) ; b . className = "netgis-table-wrapper" ; var c = document . createElement ( "table" ) ; b . appendChild ( c ) ; var d = document . createElement ( "thead" ) ; c . appendChild ( d ) ; var e = document . createElement ( "tr" ) ; e . className = "netgis-light" ; e . style . position = "sticky" ; d . appendChild ( e ) ; for ( d = 0 ; d < a . length ; d ++ ) { var f = document . createElement ( "th" ) ; f . innerHTML = a [ d ] ; e . appendChild ( f ) } a = document . createElement ( "tbody" ) ; c . appendChild ( a ) ; return b } ;
netgis . SearchParcel . prototype . createParcelItem = function ( a , b , c , d , e , f , g ) { var h = document . createElement ( "tr" ) ; h . className = "netgis-hover-light netgis-hover-text-primary" ; h . setAttribute ( "title" , "Klicken zum zoomen" ) ; h . setAttribute ( "data-bbox" , f ) ; h . setAttribute ( "data-geom" , g ) ; h . addEventListener ( "mouseenter" , this . onParcelEnter . bind ( this ) ) ; h . addEventListener ( "mouseleave" , this . onParcelLeave . bind ( this ) ) ; h . addEventListener ( "click" , this . onParcelClick . bind ( this ) ) ; f = document . createElement ( "td" ) ; h . appendChild ( f ) ;
g = document . createElement ( "button" ) ; g . setAttribute ( "type" , "button" ) ; g . setAttribute ( "title" , "Geometrie \u00fcbernehmen" ) ; g . addEventListener ( "click" , this . onParcelImportClick . bind ( this ) ) ; g . className = "netgis-text-primary netgis-hover-primary" ; g . innerHTML = "<i class='fas fa-paste'></i>" ; f . appendChild ( g ) ; f = document . createElement ( "td" ) ; f . innerHTML = a ; h . appendChild ( f ) ; a = document . createElement ( "td" ) ; a . innerHTML = b ; h . appendChild ( a ) ; b = document . createElement ( "td" ) ; b . innerHTML = c ; h . appendChild ( b ) ; c = document . createElement ( "td" ) ;
c . innerHTML = d ; h . appendChild ( c ) ; d = document . createElement ( "td" ) ; d . innerHTML = e ; h . appendChild ( d ) ; return h } ;
netgis . SearchParcel . prototype . reset = function ( ) { this . nameLoader . classList . add ( "netgis-hide" ) ; this . nameInput . value = "" ; this . districtInput . value = "" ; this . fieldInput . value = "" ; this . parcelInputA . value = "" ; this . parcelInputB . value = "" ; this . nameList . innerHTML = "" ; this . parcelInfo . innerHTML = "" ; this . parcelList . innerHTML = "" ; this . parcelTable . classList . add ( "netgis-hide" ) ; this . parcelReset . classList . add ( "netgis-hide" ) ; this . root . scrollTop = 0 } ;
netgis . SearchParcel . prototype . onInputNameKey = function ( a ) { switch ( a . keyCode ) { case 13 : this . selectFirstName ( ) ; break ; case 27 : this . reset ( ) ; break ; default : this . requestName ( this . nameInput . value . trim ( ) ) } } ;
netgis . SearchParcel . prototype . requestName = function ( a ) { this . nameDebounce && window . clearTimeout ( this . nameDebounce ) ; if ( 0 !== a . length ) { var b = this . client . config . searchParcel . nameURL ; b = netgis . util . replace ( b , "{q}" , window . encodeURIComponent ( a ) ) ; this . nameDebounce = window . setTimeout ( this . onInputNameDebounce . bind ( this , b ) , 200 ) ; this . nameLoader . classList . remove ( "netgis-hide" ) } } ; netgis . SearchParcel . prototype . onInputNameDebounce = function ( a ) { netgis . util . request ( a , this . onInputNameResponse . bind ( this ) ) } ;
netgis . SearchParcel . prototype . onInputNameResponse = function ( a ) { this . nameLoader . classList . add ( "netgis-hide" ) ; this . nameList . innerHTML = "" ; if ( "{" === a . charAt ( 0 ) || "[" === a . charAt ( 0 ) ) { a = JSON . parse ( a ) ; for ( var b = 0 ; b < a . data . length ; b ++ ) { var c = a . data [ b ] , d = this . createNameItem ( c . gmk _name ) ; d . getElementsByTagName ( "button" ) [ 0 ] . setAttribute ( "data-id" , c . gmk _gmn ) ; this . nameList . appendChild ( d ) } } } ;
netgis . SearchParcel . prototype . onNameItemClick = function ( a ) { a = a . target ; var b = a . getAttribute ( "data-id" ) ; this . nameInput . value = a . innerHTML ; this . nameList . innerHTML = "" ; this . districtInput . value = b } ; netgis . SearchParcel . prototype . selectFirstName = function ( ) { var a = this . nameList . getElementsByTagName ( "button" ) ; 0 < a . length && a [ 0 ] . click ( ) } ; netgis . SearchParcel . prototype . onParcelSearchClick = function ( a ) { this . requestParcel ( this . districtInput . value . trim ( ) , this . fieldInput . value . trim ( ) , this . parcelInputA . value . trim ( ) , this . parcelInputB . value . trim ( ) ) } ;
netgis . SearchParcel . prototype . requestParcel = function ( a , b , c , d ) { var e = this . client . config . searchParcel . parcelURL ; e = netgis . util . replace ( e , "{district}" , a ? a : "" ) ; e = netgis . util . replace ( e , "{field}" , b ? b : "" ) ; e = netgis . util . replace ( e , "{parcelA}" , c ? c : "" ) ; e = netgis . util . replace ( e , "{parcelB}" , d ? d : "" ) ; this . parcelTable . classList . add ( "netgis-hide" ) ; this . parcelList . innerHTML = "" ; this . parcelInfo . innerHTML = "Suche Flurst\u00fccke..." ; netgis . util . request ( e , this . onParcelResponse . bind ( this ) ) } ;
netgis . SearchParcel . prototype . onParcelResponse = function ( a ) { a = JSON . parse ( a ) ; if ( 0 === a . count ) this . parcelInfo . innerHTML = a . Info ; else { this . parcelInfo . innerHTML = "Flurst\u00fccke gefunden: <span class='netgis-text-primary'>" + a . count + "</span>" ; for ( var b = 0 ; b < a . data . length ; b ++ ) { var c = a . data [ b ] ; c = this . createParcelItem ( c . fln , c . fsn _zae , c . fsn _nen , c . fsk , c . flaeche , c . bbox , c . geometry ) ; this . parcelList . appendChild ( c ) } this . parcelTable . classList . remove ( "netgis-hide" ) } this . parcelReset . classList . remove ( "netgis-hide" ) ; this . root . classList . contains ( "netgis-hide" ) ||
this . parcelTable . scrollIntoView ( ) } ; netgis . SearchParcel . prototype . onParcelEnter = function ( a ) { a = a . target . getAttribute ( "data-geom" ) ; this . client . invoke ( netgis . Events . PARCEL _SHOW _PREVIEW , { geom : a } ) } ; netgis . SearchParcel . prototype . onParcelLeave = function ( a ) { this . client . invoke ( netgis . Events . PARCEL _HIDE _PREVIEW , null ) } ; netgis . SearchParcel . prototype . onParcelClick = function ( a ) { a = a . currentTarget . getAttribute ( "data-bbox" ) ; this . client . invoke ( netgis . Events . MAP _ZOOM _WKT , a ) } ;
netgis . SearchParcel . prototype . onParcelImportClick = function ( a ) { a = a . currentTarget . parentElement . parentElement . getAttribute ( "data-geom" ) ; this . client . invoke ( netgis . Events . IMPORT _WKT , a ) } ; netgis . SearchParcel . prototype . onParcelResetClick = function ( a ) { this . reset ( ) } ; netgis . SearchParcel . prototype . onSetMode = function ( a ) { a === netgis . Modes . SEARCH _PARCEL && this . root . classList . contains ( "netgis-hide" ) ? this . root . classList . remove ( "netgis-hide" ) : this . root . classList . add ( "netgis-hide" ) } ;
netgis . SearchParcel . prototype . onLayerListToggle = function ( a ) { this . root . classList . add ( "netgis-hide" ) } ; netgis = netgis || { } ; netgis . SearchPlace = function ( ) { this . lastRequest = this . timeout = this . client = null } ; netgis . SearchPlace . prototype . load = function ( ) { this . client . on ( netgis . Events . SEARCH _PLACE _REQUEST , this . onSearchPlaceRequest . bind ( this ) ) } ;
netgis . SearchPlace . prototype . request = function ( a ) { if ( this . client . config . search && this . client . config . search . url ) { var b = this . client . config . search . url ; a = a . trim ( ) ; b = netgis . util . replace ( b , "{q}" , window . encodeURIComponent ( a ) ) ; b = netgis . util . replace ( b , "{epsg}" , 4326 ) ; b = window . encodeURI ( b ) ; this . lastRequest = netgis . util . request ( b , this . onSearchPlaceResponse . bind ( this ) ) } else console . warn ( "No search API url configured for place search!" ) } ;
netgis . SearchPlace . prototype . onSearchPlaceRequest = function ( a ) { var b = a . query , c = this ; this . lastRequest && this . lastRequest . abort ( ) ; this . timeout && window . clearTimeout ( this . timeout ) ; this . timeout = window . setTimeout ( function ( ) { c . request ( b ) } , 300 ) } ; netgis . SearchPlace . prototype . onSearchPlaceResponse = function ( a ) { a = JSON . parse ( a ) ; this . client . invoke ( netgis . Events . SEARCH _PLACE _RESPONSE , a ) } ; netgis = netgis || { } ;
netgis . SLD = function ( ) { return { read : function ( a , b ) { var c = { } ; a = ( new DOMParser ) . parseFromString ( a , "text/xml" ) . getElementsByTagName ( "NamedLayer" ) ; for ( var d = 0 ; d < a . length ; d ++ ) { var e = a [ d ] , f = e . getElementsByTagName ( "se:Name" ) [ 0 ] . innerHTML ; console . info ( "Layer:" , f ) ; e = e . getElementsByTagName ( "se:FeatureTypeStyle" ) ; for ( f = 0 ; f < e . length ; f ++ ) for ( var g = e [ f ] . getElementsByTagName ( "se:Rule" ) , h = 0 ; h < g . length ; h ++ ) { var k = g [ h ] , m = k . getElementsByTagName ( "se:Name" ) [ 0 ] . innerHTML ; console . info ( "Rule:" , m ) ; m = k . getElementsByTagName ( "se:PolygonSymbolizer" ) [ 0 ] ; k =
m . getElementsByTagName ( "se:Fill" ) [ 0 ] ; m = m . getElementsByTagName ( "se:Stroke" ) [ 0 ] ; c . polygon = { fill : k . querySelector ( "[name='fill']" ) . innerHTML , stroke : m . querySelector ( "[name='stroke']" ) . innerHTML , strokeWidth : Number . parseFloat ( m . querySelector ( "[name='stroke-width']" ) . innerHTML ) } } } console . info ( "SLD:" , c ) ; b . invoke ( netgis . Events . MAP _UPDATE _STYLE , c ) ; return c } } } ( ) ; netgis = netgis || { } ; netgis . Toolbar = function ( ) { this . client = null ; this . toolbars = { } ; this . searchValue = "" } ;
netgis . Toolbar . prototype . load = function ( ) { this . root = document . createElement ( "section" ) ; this . root . className = "netgis-toolbars" ; if ( this . client . editable ) { this . toolbars [ netgis . Modes . DRAW _POINTS ] = this . createToolbar ( ) ; this . append ( this . toolbars [ netgis . Modes . DRAW _POINTS ] , this . createToolbarButton ( '<i class="fas fa-times"></i><span>Punkte zeichnen:</span>' , this . onToolbarClose . bind ( this ) ) ) ; this . append ( this . toolbars [ netgis . Modes . DRAW _POINTS ] , this . createToolbarCheckbox ( "Einrasten" , this . onSnapChange . bind ( this ) ) ) ;
netgis . SLD = function ( ) { return { read : function ( a , b ) { var c = { } ; a = ( new DOMParser ) . parseFromString ( a , "text/xml" ) . getElementsByTagName ( "NamedLayer" ) ; for ( var d = 0 ; d < a . length ; d ++ ) { var e = a [ d ] , f = e . getElementsByTagName ( "se:Name" ) [ 0 ] . innerHTML ; console . info ( "Layer:" , f ) ; e = e . getElementsByTagName ( "se:FeatureTypeStyle" ) ; for ( f = 0 ; f < e . length ; f ++ ) for ( var g = e [ f ] . getElementsByTagName ( "se:Rule" ) , h = 0 ; h < g . length ; h ++ ) { var k = g [ h ] , l = k . getElementsByTagName ( "se:Name" ) [ 0 ] . innerHTML ; console . info ( "Rule:" , l) ; l = k . getElementsByTagName ( "se:PolygonSymbolizer" ) [ 0 ] ; k =
l . getElementsByTagName ( "se:Fill" ) [ 0 ] ; l= l . getElementsByTagName ( "se:Stroke" ) [ 0 ] ; c . polygon = { fill : k . querySelector ( "[name='fill']" ) . innerHTML , stroke : l . querySelector ( "[name='stroke']" ) . innerHTML , strokeWidth : Number . parseFloat ( l . querySelector ( "[name='stroke-width']" ) . innerHTML ) } } } console . info ( "SLD:" , c ) ; b . invoke ( netgis . Events . MAP _UPDATE _STYLE , c ) ; return c } } } ( ) ; netgis = netgis || { } ; netgis . Toolbar = function ( ) { this . client = null ; this . toolbars = { } ; this . searchValue = "" } ;
netgis . Toolbar . prototype . load = function ( ) { var a = this . client . config ; this . root = document . createElement ( "section" ) ; this . root . className = "netgis-toolbars" ; if ( this . client . editable ) { this . toolbars [ netgis . Modes . DRAW _POINTS ] = this . createToolbar ( ) ; this . append ( this . toolbars [ netgis . Modes . DRAW _POINTS ] , this . createToolbarButton ( '<i class="fas fa-times"></i><span>Punkte zeichnen:</span>' , this . onToolbarClose . bind ( this ) ) ) ; this . append ( this . toolbars [ netgis . Modes . DRAW _POINTS ] , this . createToolbarCheckbox ( "Einrasten" , this . onSnapChange . bind ( this ) ) ) ;
this . root . appendChild ( this . toolbars [ netgis . Modes . DRAW _POINTS ] ) ; this . toolbars [ netgis . Modes . DRAW _LINES ] = this . createToolbar ( ) ; this . append ( this . toolbars [ netgis . Modes . DRAW _LINES ] , this . createToolbarButton ( '<i class="fas fa-times"></i><span>Linien zeichnen:</span>' , this . onToolbarClose . bind ( this ) ) ) ; this . append ( this . toolbars [ netgis . Modes . DRAW _LINES ] , this . createToolbarCheckbox ( "Einrasten" , this . onSnapChange . bind ( this ) ) ) ; this . root . appendChild ( this . toolbars [ netgis . Modes . DRAW _LINES ] ) ; this . toolbars [ netgis . Modes . DRAW _POLYGONS ] =
this . createToolbar ( ) ; this . append ( this . toolbars [ netgis . Modes . DRAW _POLYGONS ] , this . createToolbarButton ( '<i class="fas fa-times"></i><span>Polygone zeichnen:</span>' , this . onToolbarClose . bind ( this ) ) ) ; this . append ( this . toolbars [ netgis . Modes . DRAW _POLYGONS ] , this . createToolbarCheckbox ( "Einrasten" , this . onSnapChange . bind ( this ) ) ) ; this . root . appendChild ( this . toolbars [ netgis . Modes . DRAW _POLYGONS ] ) ; this . toolbars [ netgis . Modes . CUT _FEATURE _BEGIN ] = this . createToolbar ( ) ; this . append ( this . toolbars [ netgis . Modes . CUT _FEATURE _BEGIN ] ,
this . createToolbarButton ( '<i class="fas fa-times"></i><span>Feature zum Ausschneiden w\u00e4hlen:</span>' , this . onToolbarClose . bind ( this ) ) ) ; this . root . appendChild ( this . toolbars [ netgis . Modes . CUT _FEATURE _BEGIN ] ) ; this . toolbars [ netgis . Modes . CUT _FEATURE _DRAW ] = this . createToolbar ( ) ; this . append ( this . toolbars [ netgis . Modes . CUT _FEATURE _DRAW ] , this . createToolbarButton ( '<i class="fas fa-times"></i><span>Fl\u00e4che zum Ausschneiden zeichnen:</span>' , this . onToolbarClose . bind ( this ) ) ) ; this . root . appendChild ( this . toolbars [ netgis . Modes . CUT _FEATURE _DRAW ] ) ;
this . toolbars [ netgis . Modes . MODIFY _FEATURES ] = this . createToolbar ( ) ; this . append ( this . toolbars [ netgis . Modes . MODIFY _FEATURES ] , this . createToolbarButton ( '<i class="fas fa-times"></i><span>Features verschieben:</span>' , this . onToolbarClose . bind ( this ) ) ) ; this . root . appendChild ( this . toolbars [ netgis . Modes . MODIFY _FEATURES ] ) ; this . toolbars [ netgis . Modes . DELETE _FEATURES ] = this . createToolbar ( ) ; this . append ( this . toolbars [ netgis . Modes . DELETE _FEATURES ] , this . createToolbarButton ( '<i class="fas fa-times"></i><span>Features l\u00f6schen:</span>' ,
this . onToolbarClose . bind ( this ) ) ) ; this . root . appendChild ( this . toolbars [ netgis . Modes . DELETE _FEATURES ] ) ; this . toolbars [ netgis . Modes . BUFFER _FEATURE _BEGIN ] = this . createToolbar ( ) ; this . append ( this . toolbars [ netgis . Modes . BUFFER _FEATURE _BEGIN ] , this . createToolbarButton ( '<i class="fas fa-times"></i><span>Feature zum Puffern w\u00e4hlen:</span>' , this . onToolbarClose . bind ( this ) ) ) ; this . root . appendChild ( this . toolbars [ netgis . Modes . BUFFER _FEATURE _BEGIN ] ) ; this . toolbars [ netgis . Modes . BUFFER _FEATURE _EDIT ] = this . createToolbar ( ) ;
this . append ( this . toolbars [ netgis . Modes . BUFFER _FEATURE _EDIT ] , this . createToolbarButton ( '<i class="fas fa-times"></i><span>Feature puffern:</span>' , this . onBufferCancel . bind ( this ) ) ) ; this . append ( this . toolbars [ netgis . Modes . BUFFER _FEATURE _EDIT ] , this . createToolbarInput ( "Radius in Meter:" , this . client . config . tools . buffer . defaultRadius , this . onBufferChange . bind ( this ) ) ) ; this . append ( this . toolbars [ netgis . Modes . BUFFER _FEATURE _EDIT ] , this . createToolbarInput ( "Segmente:" , this . client . config . tools . buffer . defaultSegments ,
this . onBufferChange . bind ( this ) ) ) ; this . append ( this . toolbars [ netgis . Modes . BUFFER _FEATURE _EDIT ] , this . createToolbarButton ( '<i class="fas fa-check"></i><span>OK</span>' , this . onBufferAccept . bind ( this ) ) ) ; var a = this . toolbars [ netgis . Modes . BUFFER _FEATURE _EDIT ] . getElementsByTagName ( "input" ) ; a [ 0 ] . addEventListener ( "keyup" , this . onBufferKeyUp . bind ( this ) ) ; a [ 1 ] . addEventListener ( "keyup" , this . onBufferKeyUp . bind ( this ) ) ; a [ 1 ] . setAttribute ( "min" , 1 ) ; this . root . appendChild ( this . toolbars [ netgis . Modes . BUFFER _FEATURE _EDIT ] ) } this . toolbars [ netgis . Modes . SEARCH _PLACE ] =
this . createToolbar ( ) ; this . append ( this . toolbars [ netgis . Modes . SEARCH _PLACE ] , this . createToolbarButton ( '<i class="fas fa-times"></i><span>Suche:</span>' , this . onToolbarClose . bind ( this ) ) ) ; a = this . createToolbarInputText ( "Adresse..." , "" , null ) ; a . style . position = "relative" ; this . searchInput = a . getElementsByTagName ( "input" ) [ 0 ] ; this . searchInput . addEventListener ( "keyup" , this . onSearchKeyUp . bind ( this ) ) ; this . searchInput . addEventListener ( "focus" , this . onSearchFocus . bind ( this ) ) ; this . searchInput . addEventListener ( "blur" ,
this . onSearchBlur . bind ( this ) ) ; this . append ( this . toolbars [ netgis . Modes . SEARCH _PLACE ] , a ) ; this . searchList = document . createElement ( "ul" ) ; this . searchList . className = "netgis-dropdown-content netgis-search-list netgis-dialog netgis-shadow netgis-hide" ; a . appendChild ( this . searchList ) ; this . append ( this . toolbars [ netgis . Modes . SEARCH _PLACE ] , this . createToolbarButton ( '<i class="fas fa-undo"></i>' , this . onSearchClear . bind ( this ) ) ) ; this . root . appendChild ( this . toolbars [ netgis . Modes . SEARCH _PLACE ] ) ; this . client . root . appendChild ( this . root ) ;
this . client . on ( netgis . Events . SET _MODE , this . onSetMode . bind ( this ) ) ; this . client . on ( netgis . Events . SEARCH _PLACE _RESPONSE , this . onSearchPlaceResponse . bind ( this ) ) } ; netgis . Toolbar . prototype . createToolbar = function ( ) { var a = document . createElement ( "div" ) ; a . className = "netgis-toolbar netgis-dialog netgis-shadow netgis-hide" ; var b = document . createElement ( "div" ) ; a . appendChild ( b ) ; return a } ; netgis . Toolbar . prototype . append = function ( a , b ) { a . getElementsByTagName ( "div" ) [ 0 ] . appendChild ( b ) } ;
netgis . Toolbar . prototype . createToolbarButton = function ( a , b ) { var c = document . createElement ( "button" ) ; c . setAttribute ( "type" , "button" ) ; c . className = "netgis-hover-light" ; c . innerHTML = a ; c . addEventListener ( "click" , b ) ; return c } ;
var b = 1E3 , c = 3 ; netgis . util . isDefined ( a . tools ) && ( netgis . util . isDefined ( a . tools . buffer . defaultRadius ) && ( b = a . tools . buffer . defaultRadius ) , netgis . util . isDefined ( a . tools . buffer . defaultSegments ) && ( c = a . tools . buffer . defaultSegments ) ) ; this . append ( this . toolbars [ netgis . Modes . BUFFER _FEATURE _EDIT ] , this . createToolbarButton ( '<i class="fas fa-times"></i><span>Feature puffern:</span>' , this . onBufferCancel . bind ( this ) ) ) ; this . append ( this . toolbars [ netgis . Modes . BUFFER _FEATURE _EDIT ] , this . createToolbarInput ( "Radius in Meter:" ,
b , this . onBufferChange . bind ( this ) ) ) ; this . append ( this . toolbars [ netgis . Modes . BUFFER _FEATURE _EDIT ] , this . createToolbarInput ( "Segmente:" , c , this . onBufferChange . bind ( this ) ) ) ; this . append ( this . toolbars [ netgis . Modes . BUFFER _FEATURE _EDIT ] , this . createToolbarButton ( '<i class="fas fa-check"></i><span>OK</span>' , this . onBufferAccept . bind ( this ) ) ) ; a = this . toolbars [ netgis . Modes . BUFFER _FEATURE _EDIT ] . getElementsByTagName ( "input" ) ; a [ 0 ] . addEventListener ( "keyup" , this . onBufferKeyUp . bind ( this ) ) ; a [ 1 ] . addEventListener ( "keyup" ,
this . onBufferKeyUp . bind ( this ) ) ; a [ 1 ] . setAttribute ( "min" , 1 ) ; this . root . appendChild ( this . toolbars [ netgis . Modes . BUFFER _FEATURE _EDIT ] ) } this . toolbars [ netgis . Modes . SEARCH _PLACE ] = this . createToolbar ( ) ; this . append ( this . toolbars [ netgis . Modes . SEARCH _PLACE ] , this . createToolbarButton ( '<i class="fas fa-times"></i><span>Suche:</span>' , this . onToolbarClose . bind ( this ) ) ) ; a = this . createToolbarInputText ( "Adresse..." , "" , null ) ; a . style . position = "relative" ; this . searchInput = a . getElementsByTagName ( "input" ) [ 0 ] ; this . searchInput . addEventListener ( "keyup" ,
this . onSearchKeyUp . bind ( this ) ) ; this . searchInput . addEventListener ( "focus" , this . onSearchFocus . bind ( this ) ) ; this . searchInput . addEventListener ( "blur" , this . onSearchBlur . bind ( this ) ) ; this . append ( this . toolbars [ netgis . Modes . SEARCH _PLACE ] , a ) ; this . searchList = document . createElement ( "ul" ) ; this . searchList . className = "netgis-dropdown-content netgis-search-list netgis-dialog netgis-shadow netgis-hide" ; a . appendChild ( this . searchList ) ; this . append ( this . toolbars [ netgis . Modes . SEARCH _PLACE ] , this . createToolbarButton ( '<i class="fas fa-undo"></i>' ,
this . onSearchClear . bind ( this ) ) ) ; this . root . appendChild ( this . toolbars [ netgis . Modes . SEARCH _PLACE ] ) ; this . client . root . appendChild ( this . root ) ; this . client . on ( netgis . Events . SET _MODE , this . onSetMode . bind ( this ) ) ; this . client . on ( netgis . Events . SEARCH _PLACE _RESPONSE , this . onSearchPlaceResponse . bind ( this ) ) } ; netgis . Toolbar . prototype . createToolbar = function ( ) { var a = document . createElement ( "div" ) ; a . className = "netgis-toolbar netgis-dialog netgis-shadow netgis-hide" ; var b = document . createElement ( "div" ) ; a . appendChild ( b ) ; return a } ;
netgis . Toolbar . prototype . append = function ( a , b ) { a . getElementsByTagName ( "div" ) [ 0 ] . appendChild ( b ) } ; netgis . Toolbar . prototype . createToolbarButton = function ( a , b ) { var c = document . createElement ( "button" ) ; c . setAttribute ( "type" , "button" ) ; c . className = "netgis-hover-light" ; c . innerHTML = a ; c . addEventListener ( "click" , b ) ; return c } ;
netgis . Toolbar . prototype . createToolbarCheckbox = function ( a , b ) { var c = document . createElement ( "label" ) ; c . className = "netgis-hover-light" ; var d = document . createElement ( "input" ) ; d . setAttribute ( "type" , "checkbox" ) ; d . addEventListener ( "change" , b ) ; c . appendChild ( d ) ; a = document . createTextNode ( a ) ; c . appendChild ( a ) ; return c } ;
netgis . Toolbar . prototype . createToolbarInput = function ( a , b , c ) { var d = document . createElement ( "label" ) ; d . className = "netgis-hover-light" ; a = document . createTextNode ( a ) ; d . appendChild ( a ) ; a = document . createElement ( "input" ) ; a . setAttribute ( "type" , "number" ) ; a . setAttribute ( "min" , 0 ) ; a . value = b ; a . addEventListener ( "change" , c ) ; d . appendChild ( a ) ; return d } ;
netgis . Toolbar . prototype . createToolbarInputText = function ( a , b , c ) { var d = document . createElement ( "label" ) ; d . className = "netgis-hover-light" ; var e = document . createElement ( "input" ) ; e . setAttribute ( "type" , "text" ) ; e . setAttribute ( "placeholder" , a ) ; e . value = b ; c && e . addEventListener ( "change" , c ) ; d . appendChild ( e ) ; return d } ;
@ -164,4 +188,4 @@ netgis.Toolbar.prototype.updateBuffer=function(){var a=this.toolbars[netgis.Mode
netgis . Toolbar . prototype . onBufferAccept = function ( a ) { this . client . invoke ( netgis . Events . BUFFER _ACCEPT , null ) ; this . client . invoke ( netgis . Events . SET _MODE , netgis . Modes . VIEW ) } ; netgis . Toolbar . prototype . onBufferCancel = function ( a ) { this . client . invoke ( netgis . Events . BUFFER _CANCEL , null ) ; this . client . invoke ( netgis . Events . SET _MODE , netgis . Modes . VIEW ) } ;
netgis . Toolbar . prototype . onSnapChange = function ( a ) { a = a . target . checked ; this . toolbars [ netgis . Modes . DRAW _POINTS ] . getElementsByTagName ( "input" ) [ 0 ] . checked = a ; this . toolbars [ netgis . Modes . DRAW _LINES ] . getElementsByTagName ( "input" ) [ 0 ] . checked = a ; this . toolbars [ netgis . Modes . DRAW _POLYGONS ] . getElementsByTagName ( "input" ) [ 0 ] . checked = a ; this . client . invoke ( a ? netgis . Events . SNAP _ON : netgis . Events . SNAP _OFF , null ) } ; netgis = netgis || { } ;
netgis . util = function ( ) { var a = function ( a , c ) { for ( var b in a ) a . hasOwnProperty ( b ) && c ( b , a [ b ] ) } ; return { isDefined : function ( a ) { return "undefined" !== typeof a } , isString : function ( a ) { return "string" === typeof a || a instanceof String } , replace : function ( a , c , d ) { return a . replace ( new RegExp ( c , "g" ) , d ) } , foreach : a , template : function ( b , c ) { a ( c , function ( a , c ) { b = b . replace ( new RegExp ( "{" + a + "}" , "g" ) , c ) } ) ; return b } , newlines : function ( a ) { return a . replace ( /\n/g , "<br />" ) } , create : function ( a ) { var b = document . createElement ( "tbody" ) ; b . innerHTML =
a ; return b . children [ 0 ] } , size : function ( a ) { a = ( new TextEncoder ) . encode ( JSON . stringify ( a ) ) . length ; var b = a / 1024 ; return { bytes : a , kilobytes : b , megabytes : b / 1024 } } , request : function ( a , c ) { var b = new XMLHttpRequest ; b . onload = function ( ) { c ( this . responseText ) } ; b . open ( "GET" , a , ! 0 ) ; b . send ( ) } , padstr : function ( a , c ) { for ( a = a . toString ( ) ; a . length < c ; ) a = "0" + a ; return a } }} ( ) ;
a ; return b . children [ 0 ] } , size : function ( a ) { a = ( new TextEncoder ) . encode ( JSON . stringify ( a ) ) . length ; var b = a / 1024 ; return { bytes : a , kilobytes : b , megabytes : b / 1024 } } , request : function ( a , c ) { var b = new XMLHttpRequest ; b . onload = function ( ) { c ( this . responseText ) } ; b . open ( "GET" , a , ! 0 ) ; b . send ( ) } , padstr : function ( a , c ) { for ( a = a . toString ( ) ; a . length < c ; ) a = "0" + a ; return a } ,merge : function ( a , c ) { return Object . assign ( a , c ) } }} ( ) ;