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

Disappear polygon in map #337

Open
vanithaak opened this issue Nov 3, 2022 · 0 comments
Open

Disappear polygon in map #337

vanithaak opened this issue Nov 3, 2022 · 0 comments
Labels

Comments

@vanithaak
Copy link

var geocoder = L.Control.geocoder({
  defaultMarkGeocode: false
})
  .on('markgeocode', function(e) {
    var bbox = e.geocode.bbox;
    var poly = L.polygon([
      bbox.getSouthEast(),
      bbox.getNorthEast(),
      bbox.getNorthWest(),
      bbox.getSouthWest()
    ]).addTo(map);
    map.fitBounds(poly.getBounds());
  })
  .addTo(map);

I used this as mentioned in README file, but I'd like to make the polygon disappear after few seconds. I used setTImeout function here function(e) { and I get an error that it's not able to read e.geocode.bbox.

How can I achieve this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants