Skip to content
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

Add developer guidance for implementing frontend polygon simplification via turfjs #417

Open
whatisgalen opened this issue May 13, 2024 · 0 comments

Comments

@whatisgalen
Copy link
Member

whatisgalen commented May 13, 2024

describe the issue

Move the commented lines below from map-popup-provider.js:

define([
    'arches',
    'knockout',
    'turf',
    'templates/views/components/map-popup.htm'
], function(arches, ko, turf, popupTemplate) {

...

sendFeatureToMapFilter: function(popupFeatureObject)
        {
            let feature = popupFeatureObject.geometries()[0].geom.features[0];
            // Note that polygons with very high vertex-counts can benefit from simplification.
            // To use turf.js library, uncomment the next 3 lines:
            // const tolerance = 0.1; // Degree of Simplification: Lower numbers are less simplified, preserving more detail
            // const highQuality = true; // Set to true for a slower but higher quality simplification
            // turf.simplify(feature.geometry, {tolerance: tolerance, highQuality: highQuality, mutate: true});
            popupFeatureObject.mapCard.filterByFeatureGeom(feature, popupFeatureObject.resourceinstanceid);
        },

into the documentation in a section ostensibly titled "Simplifying polygons (with high vertex-count) on the frontend" and provide as a code example the above implementation, along with

please add links to existing docs or code (if relevant)
which release does this issue concern?

7.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant