-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert latitude/longitude fields with GeoJSON for map data #93
base: main
Are you sure you want to change the base?
Conversation
I have raised the PR with a brand new approach with no new extra Eagerly awaiting feedbacks . Thanks ! |
I have resolved the conflicts in the meantime here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please tell me why you need to commit a convertToGeoJSON.js
script for the repo? If this is for automation, you can keep it locally and need not submit it with the rest of the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also undo the unrelated formatting changes introduced to the YAML files in this PR?
Yes it was for it . I will be updating it now . |
Sure ! |
I will be making the changes along with resolving the conflicts . Thanks ! |
Hello Sir, I’ve corrected the formatting of the YAML files. Actually , the Please review the changes. Thank you! |
Hi Sir, I wanted to know your feedback if my approach this time is better than the previous . |
Fixes #5
Description :
-This PR introduces the following changes to improve the handling of map data in the user stories.
Changes Made :
1.Replaced latitude and longitude fields with a
geojson
field:-The
geojson
field now stores spatial data as a GeoJSON string, aligning with Decap CMS's map widget requirements.-This eliminates redundancy and ensures consistency in how map data is stored and used.
2.Updated
config.yml
:-Removed the latitude and longitude fields from the Decap CMS admin interface.
-Added a
geojson
field with the map widget, allowing users to select a point on the map directly.3.Modified
map.jsx
:-Updated the GraphQL query to fetch the
geojson
field instead of latitude and longitude.-Parsed the
geojson
string to extract coordinates and render map markers.4.Script to Migrate Existing Data:
-Added a script (
convertToGeoJSON.js
) to migrate existing latitude and longitude values to the geojson field in all index.yaml files.Impact :
1.Simplified Data Structure: The
geojson
field serves as a single source of truth for map data, reducing redundancy and potential inconsistencies.2.Alignment with Decap CMS: The changes align with Decap CMS's map widget, which expects spatial data in GeoJSON format.
3.Improved User Experience: Users can now select a point on the map directly in the admin interface, making it easier to input and manage map data.
Testing
latitude
andlongitude
values were successfully migrated togeojson
.Please review it and let me know for improvements .