File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed
lib/ReactViews/Map/MapNavigation/Items Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 33#### next release (8.7.12)
44
55- support URL parameters in a GetLegendGraphic request for a layer without a style configured
6+ - Enhanced error processing for obtaining user location
67- [ The next improvement]
78
89#### 8.7.11 - 2024-12-18
Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ export class MyLocation extends MapNavigationItemController {
154154 } ) ;
155155 }
156156
157- handleLocationError ( err : any ) {
157+ handleLocationError ( err : GeolocationPositionError ) {
158158 const t = i18next . t . bind ( i18next ) ;
159159 let message = err . message ;
160160 if ( message && message . indexOf ( "Only secure origins are allowed" ) === 0 ) {
@@ -163,12 +163,19 @@ export class MyLocation extends MapNavigationItemController {
163163 const uri = new URI ( window . location ) ;
164164 const secureUrl = uri . protocol ( "https" ) . toString ( ) ;
165165 message = t ( "location.originError" , { secureUrl : secureUrl } ) ;
166+ } else if ( err . code === err . PERMISSION_DENIED ) {
167+ message = t ( "location.permissionDenied" ) ;
168+ } else if ( err . code === err . POSITION_UNAVAILABLE ) {
169+ message = t ( "location.positionUnavailable" ) ;
170+ } else if ( err . code === err . TIMEOUT ) {
171+ message = t ( "location.timeout" ) ;
166172 }
167173 this . terria . raiseErrorToUser (
168174 new TerriaError ( {
169175 sender : this ,
170176 title : t ( "location.errorGettingLocation" ) ,
171- message : message
177+ message : message ,
178+ showDetails : false
172179 } )
173180 ) ;
174181 }
Original file line number Diff line number Diff line change 6363 "myLocation" : " My Location" ,
6464 "location" : " Location" ,
6565 "originError" : " Your browser can only provide your location when using HTTPS. You may be able to use {{secureUrl}} instead." ,
66- "centreMap" : " Centre map at your current location"
66+ "centreMap" : " Centre map at your current location" ,
67+ "permissionDenied" : " Permission denied to get your location. Please check your browser settings." ,
68+ "positionUnavailable" : " Your location information is unavailable." ,
69+ "timeout" : " Obtaining your location information took to long. Please try again later."
6770 },
6871 "splitterTool" : {
6972 "errorTitle" : " Failed to compare catalog item." ,
You can’t perform that action at this time.
0 commit comments