File tree Expand file tree Collapse file tree 1 file changed +15
-9
lines changed
BlueMapCore/src/main/webroot/js/libs Expand file tree Collapse file tree 1 file changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,10 @@ export default class BlueMap {
8888
8989 this . initModules ( ) ;
9090 this . start ( ) ;
91- } ) . catch ( error => this . onLoadError ( error . toString ( ) ) ) ;
91+ } ) . catch ( error => {
92+ this . onLoadError ( error . toString ( ) )
93+ console . error ( error ) ;
94+ } ) ;
9295 }
9396
9497 initModules ( ) {
@@ -204,14 +207,17 @@ export default class BlueMap {
204207 }
205208
206209 this . locationHash =
207- '#' + this . map
208- + ':' + Math . floor ( this . controls . targetPosition . x )
209- + ':' + Math . floor ( this . controls . targetPosition . z )
210- + ':' + Math . round ( this . controls . targetDirection * 100 ) / 100
211- + ':' + Math . round ( this . controls . targetDistance * 100 ) / 100
212- + ':' + Math . ceil ( this . controls . targetAngle * 100 ) / 100
213- + ':' + Math . floor ( this . controls . targetPosition . y ) ;
214- history . replaceState ( undefined , undefined , this . locationHash ) ;
210+ '#' + this . map
211+ + ':' + Math . floor ( this . controls . targetPosition . x )
212+ + ':' + Math . floor ( this . controls . targetPosition . z )
213+ + ':' + Math . round ( this . controls . targetDirection * 100 ) / 100
214+ + ':' + Math . round ( this . controls . targetDistance * 100 ) / 100
215+ + ':' + Math . ceil ( this . controls . targetAngle * 100 ) / 100
216+ + ':' + Math . floor ( this . controls . targetPosition . y ) ;
217+ // only update hash when changed
218+ if ( window . location . hash !== this . locationHash ) {
219+ history . replaceState ( undefined , undefined , this . locationHash ) ;
220+ }
215221 } ;
216222
217223 render = ( ) => {
You can’t perform that action at this time.
0 commit comments