private void initProperties ( ) { center = new SimpleObjectProperty <> ( ) ; center . addListener ( ( observable , oldValue , newValue ) -> { // check if this is the same value that was just reported from the map using object equality if ( newValue != lastCoordinateFromMap . get ( ) ) { if ( logger . isTraceEnabled ( ) ) { logger . trace ( "center changed from {} to {}" , oldValue , newValue ) ; } setCenterInMap ( ) ; } } ) ; zoom = new SimpleDoubleProperty ( INITIAL_ZOOM ) ; zoom . addListener ( ( observable , oldValue , newValue ) -> { // check if this is the same value that was just reported from the map using object equality final Long rounded = Math . round ( ( Double ) newValue ) ; if ( ! Objects . equals ( rounded , lastZoomFromMap . get ( ) ) ) { if ( logger . isTraceEnabled ( ) ) { logger . trace ( "zoom changed from {} to {}" , oldValue , rounded ) ; } setZoomInMap ( ) ; } } ) ; animationDuration = new SimpleIntegerProperty ( 0 ) ; mapType = new SimpleObjectProperty <> ( MapType . OSM ) ; mapType . addListener ( ( observable , oldValue , newValue ) -> { if ( logger . isTraceEnabled ( ) ) { logger . trace ( "map type changed from {} to {}" , oldValue , newValue ) ; } if ( ! checkApiKey ( newValue ) ) { if ( logger . isWarnEnabled ( ) ) { logger . warn ( "no api key defined for map type {}" , newValue ) ; } mapType . set ( oldValue ) ; } if ( MapType . WMS == newValue ) { boolean wmsValid = false ; if ( wmsParam . isPresent ( ) ) { String url = wmsParam . get ( ) . getUrl ( ) ; if ( null != url && ! url . isEmpty ( ) ) { wmsValid = true ; } } if ( ! wmsValid ) { if ( logger . isWarnEnabled ( ) ) { logger . warn ( "no wms params defined for map type {}" , newValue ) ; } mapType . set ( oldValue ) ; } } if ( MapType . XYZ . equals ( newValue ) ) { boolean xyzValid = false ; if ( xyzParam . isPresent ( ) ) { String url = xyzParam . get ( ) . getUrl ( ) ; if ( null != url && ! url . isEmpty ( ) ) { xyzValid = true ; } } if ( ! xyzValid ) { if ( logger . isWarnEnabled ( ) ) { logger . warn ( "no xyz params defined for map type {}" , newValue ) ; } mapType . set ( oldValue ) ; } } setMapTypeInMap ( ) ; } ) ; }
initializes the JavaFX properties .