Skip to content

Commit

Permalink
Linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanBirtch-aot committed Dec 16, 2024
1 parent 23a3c62 commit 4e53361
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
4 changes: 2 additions & 2 deletions components/src/components/Map/services/BCGeocoderProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ export class BCGeocoderProvider extends OpenStreetMapProvider {
};
parse = ({ data }) => {
return data.features
.filter(function (feature) {
.filter((feature) => {
if (!feature.geometry.coordinates) return false;
if (feature.properties.fullAddress === 'BC') return false;
return true;
})
.map(function (feature) {
.map((feature) => {
return {
x: feature.geometry.coordinates[0],
y: feature.geometry.coordinates[1],
Expand Down
18 changes: 7 additions & 11 deletions components/src/components/Map/services/MapService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ class MapService {
e.layers.eachLayer((layer) => {
const match = this.isDefaultFeature(layer as L.Layer);
if (match) {
//re-add the feature/layer to the map
// re-add the feature/layer to the map
drawnItems.addLayer(layer);
L.popup()
.setLatLng(map.getCenter())
.setContent(`<p>Please do not delete pre-existing features</p>`)
.setContent('<p>Please do not delete pre-existing features</p>')
.addTo(map);
}
});
Expand Down Expand Up @@ -144,10 +144,6 @@ class MapService {
L.DomEvent.on(button, 'click', () => {
if ('geolocation' in navigator) {
navigator.geolocation.getCurrentPosition((position) => {
console.log(
'centering map on: ' +
[position.coords.latitude, position.coords.longitude]
);
map.setView(
[position.coords.latitude, position.coords.longitude],
14
Expand Down Expand Up @@ -296,12 +292,12 @@ class MapService {
const featureType = this.getFeatureType(feature);
const sameTypes = defaults.filter((d) => {
return d.type === featureType;
}); //filter out the types that don't match the marker to be deleted
}); // filter out the types that don't match the marker to be deleted
if (sameTypes.length === 0) {
return false;
}
return sameTypes.some((f) => {
//returns true if one of the filtered defaults
// returns true if one of the filtered defaults
switch (featureType) {
case 'marker':
return this.coordinatesEqual(f.coordinates, feature.getLatLng());
Expand Down Expand Up @@ -347,12 +343,12 @@ class MapService {
c2 = c2[0];
}
if (c1.length !== c2.length) {
//different number of vertices, no match
// different number of vertices, no match
return false;
} else {
for (var i = 0; i < c1.length; i++) {
for (let i = 0; i < c1.length; i++) {
if (!this.coordinatesEqual(c1[i], c2[i])) {
return false; //if there's no match in one of the points, it's a new feature
return false; // if there's no match in one of the points, it's a new feature
}
}
return true;
Expand Down

0 comments on commit 4e53361

Please sign in to comment.