@ -31,17 +31,17 @@ netgis.Toolbar.prototype.load = function()
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.append( this.toolbars[ netgis.Modes.DRAW_POINTS ], this.createToolbarCheckbox( "Puffern", this.onDrawBufferChange.bind( this ) ) );
//this.append( this.toolbars[ netgis.Modes.DRAW_POINTS ], this.createToolbarInput( "Radius (Meter):", bufferDefaultRadius, this.onDrawBufferRadiusChange.bind( this ) ) );
//this.append( this.toolbars[ netgis.Modes.DRAW_POINTS ], this.createToolbarInput( "Segmente:", bufferDefaultSegments, this.onDrawBufferSegmentsChange.bind( this ) ) );
this . append ( this . toolbars [ netgis . Modes . DRAW _POINTS ] , this . createToolbarCheckbox ( "Puffern" , this . onDrawBufferChange . bind ( this ) ) ) ;
this . append ( this . toolbars [ netgis . Modes . DRAW _POINTS ] , this . createToolbarInput ( "Radius (Meter):" , bufferDefaultRadius , this . onDrawBufferRadiusChange . bind ( this ) ) ) ;
this . append ( this . toolbars [ netgis . Modes . DRAW _POINTS ] , this . createToolbarInput ( "Segmente:" , bufferDefaultSegments , this . onDrawBufferSegmentsChange . 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.append( this.toolbars[ netgis.Modes.DRAW_LINES ], this.createToolbarCheckbox( "Puffern", this.onDrawBufferChange.bind( this ) ) );
//this.append( this.toolbars[ netgis.Modes.DRAW_LINES ], this.createToolbarInput( "Radius (Meter):", bufferDefaultRadius, this.onDrawBufferRadiusChange.bind( this ) ) );
//this.append( this.toolbars[ netgis.Modes.DRAW_LINES ], this.createToolbarInput( "Segmente:", bufferDefaultSegments, this.onDrawBufferSegmentsChange.bind( this ) ) );
this . append ( this . toolbars [ netgis . Modes . DRAW _LINES ] , this . createToolbarCheckbox ( "Puffern" , this . onDrawBufferChange . bind ( this ) ) ) ;
this . append ( this . toolbars [ netgis . Modes . DRAW _LINES ] , this . createToolbarInput ( "Radius (Meter):" , bufferDefaultRadius , this . onDrawBufferRadiusChange . bind ( this ) ) ) ;
this . append ( this . toolbars [ netgis . Modes . DRAW _LINES ] , this . createToolbarInput ( "Segmente:" , bufferDefaultSegments , this . onDrawBufferSegmentsChange . bind ( this ) ) ) ;
this . root . appendChild ( this . toolbars [ netgis . Modes . DRAW _LINES ] ) ;
this . showDrawBufferOptions ( false ) ;
@ -62,7 +62,7 @@ netgis.Toolbar.prototype.load = function()
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>Feature s verschieben:</span>', this . onToolbarClose . bind ( this ) ) ) ;
this . append ( this . toolbars [ netgis . Modes . MODIFY _FEATURES ] , this . createToolbarButton ( '<i class="fas fa-times"></i><span>Feature -Eckpunkte verschieben:</span>', this . onToolbarClose . bind ( this ) ) ) ;
this . root . appendChild ( this . toolbars [ netgis . Modes . MODIFY _FEATURES ] ) ;
this . toolbars [ netgis . Modes . DELETE _FEATURES ] = this . createToolbar ( ) ;
@ -198,6 +198,7 @@ netgis.Toolbar.prototype.createToolbarInput = function( title, value, callback )
input . setAttribute ( "min" , 0 ) ;
input . value = value ;
input . addEventListener ( "change" , callback ) ;
input . addEventListener ( "keyup" , callback ) ;
label . appendChild ( input ) ;
return label ;
@ -266,12 +267,12 @@ netgis.Toolbar.prototype.onSetMode = function( e )
case netgis . Modes . DRAW _LINES :
{
var checkbox = this . toolbars [ netgis . Modes . DRAW _POINTS ] . getElementsByTagName ( "input" ) [ 1 ] ;
/ *
if ( checkbox . checked )
{
this . client . invoke ( netgis . Events . DRAW _BUFFER _ON , null ) ;
}
* /
break ;
}
}
@ -496,6 +497,20 @@ netgis.Toolbar.prototype.onDrawBufferChange = function( e )
this . client . invoke ( on ? netgis . Events . DRAW _BUFFER _ON : netgis . Events . DRAW _BUFFER _OFF , null ) ;
this . showDrawBufferOptions ( on ) ;
// Update Buffer Values
if ( on )
{
var points = true ;
if ( ! this . toolbars [ netgis . Modes . DRAW _LINES ] . classList . contains ( "netgis-hide" ) ) points = false ;
var inputs = this . toolbars [ points ? netgis . Modes . DRAW _POINTS : netgis . Modes . DRAW _LINES ] . getElementsByTagName ( "input" ) ;
var radius = Number . parseInt ( inputs [ 2 ] . value ) ;
var segments = Number . parseInt ( inputs [ 3 ] . value ) ;
this . client . invoke ( netgis . Events . DRAW _BUFFER _RADIUS _CHANGE , radius ) ;
this . client . invoke ( netgis . Events . DRAW _BUFFER _SEGMENTS _CHANGE , segments ) ;
}
} ;
netgis . Toolbar . prototype . onDrawBufferRadiusChange = function ( e )
@ -533,16 +548,16 @@ netgis.Toolbar.prototype.showDrawBufferOptions = function( on )
if ( on )
{
//pointsItems[ 3 ].classList.remove( "netgis-hide" );
//pointsItems[ 4 ].classList.remove( "netgis-hide" );
//linesItems[ 3 ].classList.remove( "netgis-hide" );
//linesItems[ 4 ].classList.remove( "netgis-hide" );
pointsItems [ 3 ] . classList . remove ( "netgis-hide" ) ;
pointsItems [ 4 ] . classList . remove ( "netgis-hide" ) ;
linesItems [ 3 ] . classList . remove ( "netgis-hide" ) ;
linesItems [ 4 ] . classList . remove ( "netgis-hide" ) ;
}
else
{
//pointsItems[ 3 ].classList.add( "netgis-hide" );
//pointsItems[ 4 ].classList.add( "netgis-hide" );
//linesItems[ 3 ].classList.add( "netgis-hide" );
//linesItems[ 4 ].classList.add( "netgis-hide" );
pointsItems [ 3 ] . classList . add ( "netgis-hide" ) ;
pointsItems [ 4 ] . classList . add ( "netgis-hide" ) ;
linesItems [ 3 ] . classList . add ( "netgis-hide" ) ;
linesItems [ 4 ] . classList . add ( "netgis-hide" ) ;
}
} ;