Skip to content

Commit

Permalink
Merge pull request hpneo#24 from npepinpe/master
Browse files Browse the repository at this point in the history
drawPolygon behaves as drawPolylines
  • Loading branch information
xenda committed Jun 3, 2012
2 parents b2eaae1 + 28197f8 commit 06553ed
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions gmaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,13 @@ var GMaps = (function($) {
options = $.extend({
map: this.map
}, options);

if($.isArray(options.paths)) {
if($.isArray(options.paths[0])) {
options.paths = $.map(options.paths, arrayToLatLng);
}
}

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

var polygon_events = ['click', 'dblclick', 'mousedown', 'mousemove', 'mouseout', 'mouseover', 'mouseup', 'rightclick'];
Expand All @@ -505,6 +512,10 @@ var GMaps = (function($) {
this.polygons.push(polygon);

return polygon;

function arrayToLatLng(coords) {
return new google.maps.LatLng(coords[0], coords[1]);
}
};

this.getFromFusionTables = function(options) {
Expand Down

0 comments on commit 06553ed

Please sign in to comment.