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

Add a method to remove polygons #237

Closed
xjpmauricio opened this issue Jul 3, 2018 · 9 comments
Closed

Add a method to remove polygons #237

xjpmauricio opened this issue Jul 3, 2018 · 9 comments

Comments

@xjpmauricio
Copy link

Hi, I'm having trouble removing existing Polylines on Android (I've not tested on IOS).
This is how I add them:

this.map.addPolygon({
	id: this.circular_polyline_id,
	fillColor: new Color("#0099FF"),
	fillOpacity: 0.7,
	points: circlePoints.map(c => {
		return {
			'lat': c[1],
			'lng': c[0]
		}
	})
});

Before adding, I try to remove them like this:

this.map.removePolylines([this.circular_polyline_id]).then(response => {  

});

I've tried everything, even using setTimeout, etc.

Any ideias what I'm doing wrong?

@EddyVerbruggen
Copy link
Collaborator

You're adding a polygon but remove a polyline.

The available functions currently are: addPolygon, addPolyline, and removePolylines.

@xjpmauricio
Copy link
Author

@EddyVerbruggen, thanks for the quick response but, how do I remove an existing polygon ?

@EddyVerbruggen
Copy link
Collaborator

There's currently no exposed function to do that.

@EddyVerbruggen EddyVerbruggen changed the title RemovePolylines not working Add a method to remove polygons Jul 3, 2018
@xjpmauricio
Copy link
Author

xjpmauricio commented Jul 3, 2018

So, how could I draw a circle with a fill color without using the addPolygon function ?

This is what I can do with the addPolygon function :

addpolygon

@EddyVerbruggen
Copy link
Collaborator

You could either send a PR to add the remove function, or wait 15 minutes for me to add it.

@xjpmauricio
Copy link
Author

@EddyVerbruggen, I'll gladly wait 15 minutes for your function! :-)

@EddyVerbruggen EddyVerbruggen added this to the 4.1.1 milestone Jul 3, 2018
@EddyVerbruggen EddyVerbruggen self-assigned this Jul 3, 2018
@EddyVerbruggen
Copy link
Collaborator

EddyVerbruggen commented Jul 3, 2018

4.1.1 released ➡️ grab it while it's 🔥

Make sure to read the updated docs and or demo app to see how to use it.

@xjpmauricio
Copy link
Author

I already update to the latest version, it works! Thanks!!!

@blipk
Copy link

blipk commented Apr 7, 2019

sorry to revive old issue, but is there a way to draw circles from a centre and radius with this plugin? or will I have to draw a 'rough' circular polygon from multiple points?

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

No branches or pull requests

3 participants