@@ -13,7 +13,7 @@ class LocationGlobe {
13
13
this . parent = document . getElementById ( parentId ) ;
14
14
this . parent . innerHTML += `<div id="mod_globe">
15
15
<div id="mod_globe_innercontainer">
16
- <h1>WORLD VIEW<i>GLOBAL NETWORK MAP</i></h1>
16
+ <h1>WORLD VIEW<i class="mod_globe_location" >GLOBAL NETWORK MAP</i></h1>
17
17
<h2>ENDPOINT LAT/LON<i class="mod_globe_headerInfo">0.0000, 0.0000</i></h2>
18
18
<div id="mod_globe_canvas_placeholder"></div>
19
19
</div>
@@ -138,13 +138,14 @@ class LocationGlobe {
138
138
}
139
139
updateLoc ( ) {
140
140
try {
141
- let newgeo = window . mods . netstat . ipinfo . geo . location ;
141
+ let lang = window . settings . lang ;
142
+ let geo = window . mods . netstat . ipinfo . geo ;
143
+ let newgeo = geo . location ;
142
144
newgeo . latitude = Math . round ( newgeo . latitude * 10000 ) / 10000 ;
143
145
newgeo . longitude = Math . round ( newgeo . longitude * 10000 ) / 10000 ;
144
146
145
147
if ( newgeo . latitude !== this . lastgeo . latitude || newgeo . longitude !== this . lastgeo . longitude ) {
146
148
document . querySelector ( "i.mod_globe_headerInfo" ) . innerText = `${ newgeo . latitude } , ${ newgeo . longitude } ` ;
147
-
148
149
this . globe . pins . forEach ( pin => {
149
150
pin . remove ( ) ;
150
151
} ) ;
@@ -161,6 +162,8 @@ class LocationGlobe {
161
162
}
162
163
163
164
this . lastgeo = newgeo ;
165
+ document . querySelector ( "i.mod_globe_location" ) . innerText = `${ geo . country . names [ lang ] } ` ;
166
+ document . querySelector ( "i.mod_globe_location" ) . innerText += `,${ geo . city . names [ lang ] } `
164
167
} catch ( e ) {
165
168
document . querySelector ( "i.mod_globe_headerInfo" ) . innerText = "UNKNOWN" ;
166
169
}
0 commit comments