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

Drawing Styles #391

Closed
dbauszus-glx opened this issue Apr 9, 2021 · 1 comment
Closed

Drawing Styles #391

dbauszus-glx opened this issue Apr 9, 2021 · 1 comment
Assignees
Labels
Feature New feature requests or changes to the behaviour or look of existing application features.

Comments

@dbauszus-glx
Copy link
Member

The style assigned to the drawing interaction should be applied to the interaction as well as the feature in the drawstart event.

It should also be possible to assign an image in the style param.

@dbauszus-glx dbauszus-glx added the Feature New feature requests or changes to the behaviour or look of existing application features. label Apr 9, 2021
@dbauszus-glx dbauszus-glx self-assigned this Apr 9, 2021
@dbauszus-glx
Copy link
Member Author

The style param is now applied to the interaction itself as well as being set on the feature in the drawstart event.

It is now possible to assign an image style element in the style param for the draw interaction.

        _xyz.mapview.interaction.draw.begin({
          layer: layer,
          type: 'Point',
          style: {
            image: {
              svg: 'https://geolytix.github.io/MapIcons/pins/amber.svg',
              scale: 3,
              anchor: [0.5, 1]
            }
          },
          callback: () => {
            layer.view.querySelector('.header').classList.remove('edited', 'secondary-colour-bg');
            btn.classList.remove('active');
          }
        });

image

1c116d0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature requests or changes to the behaviour or look of existing application features.
Projects
None yet
Development

No branches or pull requests

2 participants