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

Example for adding markers dynamically #57

Open
hokiepokedad2 opened this issue Feb 16, 2021 · 2 comments
Open

Example for adding markers dynamically #57

hokiepokedad2 opened this issue Feb 16, 2021 · 2 comments

Comments

@hokiepokedad2
Copy link

Hello there. Is there an example in the docs on how to add or remove markers dynamically after the map and layers have been rendered? For instance, after a specified interval, I'd like to check a datasource for any changes. If a new element is added in the source, I'd like to add that as a marker to the map. Same for the inverse.

I tried looking in the docs, googling and examples but couldn't find anything. Any tips?

@kamilcglr
Copy link

kamilcglr commented Feb 25, 2021

Hi @hokiepokedad2, did you succeed?
I'm in the same case I don't understand how to remove the old markers.

@azzahrah
Copy link

@hokiepokedad2

  1. create sprinte var marker = new PIXI.Sprite(markerTexture);
  2. add to Container pixiContainer.addChild(marker);
  3. to remove/hide, just set sprinte to visible=false, or visible=true opposite
  4. don't forget to call renderer.render(pixiContainer);

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

3 participants