Giter Club home page Giter Club logo

Comments (2)

Viglino avatar Viglino commented on July 29, 2024 1

Hello,

A control is associated with only one map. So you have to create one control per map (as mouse position in the example).
The trick is to hide the control when the map is not concerned and show only one at a time.

You can use setMap to switch the control map when a map is active.
But don't have to use it, you can add a control per map and you just have to show / hide the control when the map is active or not (if the mouse is on the viewport or if a map is clicked).

@+

from ol-ext-angular.

umbe1987 avatar umbe1987 commented on July 29, 2024

Thank you so much again for your precious feedback!
I was able to implement the outside controls.
What I did was:

  • create one control per each map and associate each of them to one map
  • draw them concurrently BUT one on top of the other, to give the impression that it's just one control
  • create a service that, after clicking one control (they actually are all buttons in my case), handles the activation/deactivation of all other similar controls underneath
  • activation/deactivation of controls also implies adding/removing the click event listener to each maps the controls are associated with (i.e. by using e.g. this.clickKey = map.on('click', whatever) to a variable on activation and using unByKey(this.clickKey) when deactivating

Again, thankyou so much for clatrifying the 1 control -> 1 map rule, and to give me a suggestion for solving the problem!

Closing now 👍

from ol-ext-angular.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.