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.

How to clear layers?

See original GitHub issue

When the user pans around the map, I would like to clear all point data and re-load it

Previously this was markers.clearLayers()

How can this be achieved with this awesome plugin?

Thanks ❤️

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
robertleeplummerjrcommented, Apr 20, 2021

When you call:

  • glify.points()
  • glify.lines()
  • glify.shapes()

You are creating variables, instances that you’ll want to interact with. To this end, try this:

  • const myPoints = glify.points({ map, data });
    myPoints.remove();
    
  • const myLines = glify.lines({ map, data });
    myLines.remove();
    
  • const myShapes = glify.shapes({ map, data });
    myShapes.remove();
    

Conversely, you can add the layer back to a map:

  • const myPoints = glify.points();
    myPoints.addTo(map);
    
  • const myLines = glify.lines();
    myLines.addTo(map);
    
  • const myShapes = glify.shapes();
    myShapes.addTo(map);
    
0reactions
xlcrrcommented, Aug 1, 2021

I got this working at last by moving points.remove() before the request. I was trying to handle it in the response

Read more comments on GitHub >

github_iconTop Results From Across the Web

Deleting layers and clearing layer contents - Corel
Right-click on the Layers palette, and choose Delete. Delete a selected layer by dragging. Drag the layer to the Delete Layer button.
Read more >
Is there a way to Clear Layer? - Adobe Support Community
Quick workaround: add layer mask, invert layer mask, right-click on mask and apply mask. That will quickly clear layers without you having to...
Read more >
AutoCAD How To Delete Layers with Objects and ... - YouTube
AutoCAD Productivity Training Webinar Available Now (20% off): https://gumroad.com/l/oPLLa/may4 AutoCAD Layout Templates: ...
Read more >
AutoCAD How to Delete Any Layer - 3 Simple Methods!
AutoCAD Fundamentals & Workflows Course: http://cadintentions.com/hurry** AutoCAD Productivity Training Webinar Available Now 20% off: ...
Read more >
How to delete a layer in Photoshop - Trusted Reviews
Step 1. Select the layer you want to delete. This can be any layer in your PSD. Just click on it in the...
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