File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
BlueMapCore/src/main/webroot/js/libs Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -207,14 +207,17 @@ export default class BlueMap {
207207 }
208208
209209 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- 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+ }
218221 } ;
219222
220223 render = ( ) => {
You can’t perform that action at this time.
0 commit comments