Skip to content

openplacedatabase/gmaps-large-polygons

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

gmaps-large-polygons

gmaps-large-polygons makes it possible to edit large Google Maps Polygons. Without it, it's nigh impossible to edit large polygons without crashing the browser. gmaps-large-polygons fixes this by only allowing a small portion of the polygon's borders to be editable at a time.

gmaps-large-polygons works by extending the regular Polygon object so you can continue using polygons as you did before.

var polygon = new google.maps.Polygon(options);

If you never mark the polygons as editable, or if the number of points is less than the lineSize, then the polygons will behave like normal polygons.

See the demo.

Options

You may use all of the regular options for Polygons. gmaps-large-polygons makes these additional options available:

option default description
lineSize 100 The max number of points which an editable line segment will have. Segments may have less than this number but they will never have more.
highlightColor #000000 The color that line segments will turn when hovered over for selecting before editing. It can be difficult to get the mouse in the right spot for selection so this helps indicate whether the mouse is in the proper spot for selection.

Events

You may use all of the regular events for Polygons.

We also make available a new edited event that is triggered whenever a point in any of the polygon's paths is added, moved, or deleted. No arguments are passed to the event handlers for this.

About

Google Maps EditablePolygon class which makes it possible to edit large polygons

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published