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

Allow a configurable hitTolerance #680

Merged
merged 1 commit into from
Mar 8, 2024

Conversation

geographika
Copy link
Collaborator

@geographika geographika commented Mar 8, 2024

This allows an application to increase the hit tolerance when selecting features. The default is set to the OpenLayers default of 0 so any existing applications will be unaffected.

It can be applied in the Map.js file of an application which extends CpsiMapview.view.main.Map

    mapViewConfig: {
        projection: 'EPSG:2157',
        zoom: 11,
        center: [616038, 629971],
        hitTolerance: 3 // use 3 pixels when selecting features, as this makes it easier to select a line
    },

This makes it easier to select lines, rather than use the default of 1 pixel.

Clickable features are set in classes extending from CpsiMapview.controller.MapController using the clickableLayerConfigs:

    clickableLayerConfigs: {
        'NETWORKEDGES_WFS': {
            keyField: 'ObjectId',
            modelClass: 'Example.model.network.Edge',
            editWindowClass: 'Example.view.edge.EdgeWindow'
        },

@geographika geographika merged commit bd85035 into compassinformatics:master Mar 8, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

None yet

1 participant