Skip to content

Commit d48a42e

Browse files
committed
0.2.6
Fixed an issue related to latitude and longitude parsing
1 parent 743a78a commit d48a42e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,8 @@ export default class ObsidianLeaflet extends Plugin {
195195
let imageData: string;
196196
let coords: [number, number];
197197

198-
lat = parseInt(lat?.match(/(\d+)%*/)[1]);
199-
long = +parseInt(long?.match(/(\d+)%*/)[1]);
198+
lat = parseFloat(lat?.match(/(-*\d+)%*/)[1]);
199+
long = parseFloat(long?.match(/(-*\d+)%*/)[1]);
200200
if (image != 'real') {
201201

202202

@@ -228,7 +228,7 @@ export default class ObsidianLeaflet extends Plugin {
228228
if (!long || isNaN(lat)) {
229229
long = 0;
230230
}
231-
coords = [+lat, +long];
231+
coords = [lat, long];
232232
map.renderReal(coords);
233233

234234
}

0 commit comments

Comments
 (0)