question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Standard OpenLayers controls

See original GitHub issue

Currently VueLayers doesn’t has any components for OpenLayers standard controls. And the only way to work with them is through underlying ol.Map instance of the vl-map component. The main goal is to implement an all standard controls to easily work with them as Vue components:

Also an basic control mixin as a base type for all controls should be implemented to allow easy extending.

Usage example:

// by default nothing is enabled
<vl-map ...></vl-map>

// map with default set  of controls
<vl-map ...>
  <vl-control-default-set ...></vl-control-default-set>
</vl-map>

// map with custom controls markup
<vl-map ...>
  <vl-control-zoom ...></vl-control-zoom>
  <vl-control-scale-line ...></vl-control-scale-line>
  ...
</vl-map>

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ghettovoicecommented, Oct 3, 2019

Release as v0.11.5, please upgrade

0reactions
ghettovoicecommented, Dec 8, 2022

sorry, I found an error in my example. You should pass array to addControls method:

mapVm.addControls([
    new ScaleLine(...),
    new ....,
  ])

To add single control you can use: mapVm.addControl(new ScaleLine())

UPD: your import of control is correct

Read more comments on GitHub >

github_iconTop Results From Across the Web

OpenLayers v7.2.2 API - Class: Control
A control is a visible widget with a DOM element in a fixed position on the screen. They can involve user input (buttons),...
Read more >
How can I remove standard controls in an OpenLayers-Map?
The map object has a property called controls that is an array of OpenLayers.Control objects. If this property is not explicitly set then ......
Read more >
OpenLayers.Control.TransformFeature
Control to transform features with a standard transformation box. Properties. events, {OpenLayers.Events} Events instance for listeners and triggering control ...
Read more >
Removing custom controls? - GIS Stack Exchange
but what is the 'displayClass' or the 'CLASS_NAME' in the case of custom controls like my 'drawControls'?. openlayers-2 · mapcontrol · Share.
Read more >
Add and customize map controls with Angular 13 ... - Medium
OpenLayers is an open source JavaScript library that is used to add maps to websites. Here you can learn how to update existing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found