Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
planemad committed Dec 4, 2023
1 parent 097d427 commit d07c033
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions js/chennai.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ fetch('https://cloudflare.com/cdn-cgi/trace')
.then(data => {

userIpMatch = data.match(/ip=([\d.]+)/);
userLocationMatch = data.match(/colo=([\d.]+)/);
userLocationMatch = data.match(/colo=([A-Z]+)/);


user.location = userLocationMatch ? userLocationMatch[1] : null;
user.ip = userIpMatch ? userIpMatch[1] : null;

})

map.off('tile.error', map.onError);
Expand Down Expand Up @@ -202,14 +202,12 @@ function selectionHandler(data) {
if (map.getZoom() >= 15) {
let features;
features = map.queryRenderedFeatures(e.point, { layers: ['selected-roads'] })
console.log(features)
if (features.length) {
deleteRoad(data, addedRoads, addedFeatures, features);
} else {
let features;
features = map.queryRenderedFeatures(e.point, { layers: MAP_LAYERS['road'] });
if (features.length) {
console.log(features)
addRoad(data, addedRoads, addedFeatures, features);
}
}
Expand Down

0 comments on commit d07c033

Please sign in to comment.