diff --git a/README.md b/README.md index 7383a0d..f1b7d49 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ const GeoJsonlookfor = new gl.GeoJsonlookfor(geojson); ``` 4. We can look for features with "bakery" in their properties in the following ways. ```javascript -GeoJsonlookfor.lookfor('bakery'); +GeoJsonlookfor.match('bakery'); console.log(GeoJsonlookfor.getGeoJSON()); ``` @@ -78,7 +78,7 @@ const geojson = { } const GeoJsonlookfor = new gl.GeoJsonlookfor(geojson); -const res = GeoJsonlookfor.lookfor('clothing store').getGeoJSON(); +const res = GeoJsonlookfor.match('clothing store').getGeoJSON(); console.log(res); ``` @@ -108,7 +108,7 @@ console.log(res); 2. Look for a feature with "restaurant" and "A". ```typescript -const res = GeoJsonlookfor.lookfor('restaurant').lookfor('A').getGeoJSON(); +const res = GeoJsonlookfor.match('restaurant').match('A').getGeoJSON(); console.log(res); ``` diff --git a/src/utile.ts b/src/utile.ts deleted file mode 100644 index c90e2a6..0000000 --- a/src/utile.ts +++ /dev/null @@ -1,22 +0,0 @@ - - -// const filterParticularProperty = (geojson: any, conditionProperty: {[key: string]: string}) => { -// try { -// if (geojson === undefined || geojson === null || typeof geojson !== 'object' || typeof geojson === 'string') { -// throw new Error('Invalid GeoJSON'); -// } -// const features = geojson.features; -// const keys = Object.keys(conditionProperty); - -// geojson = { -// "type": "FeatureCollection", -// "features": features.filter((feature: any) => { -// return feature.properties[].includes(JSON.stringify(conditionProperty)); -// }) -// }; - -// return geojson; -// } catch (err: any) { -// throw new Error(err); -// } -// }; \ No newline at end of file