apneadiving / Google-Maps-for-Rails

Enables easy Google map + overlays creation in Ruby apps
https://apneadiving.github.io/
MIT License
2.26k stars 382 forks source link

setting editable on a polygon does not work #309

Closed kidbrax closed 10 years ago

kidbrax commented 11 years ago

I am adding a polygon upon page load using something similar to this:

basic_map_options = {
  mapTypeControl: true,
  detect_location: false,
  center_on_user: true,
  auto_adjust: false,
  libraries: ["drawing"]
}

map_view = {map_options: basic_map_options}

polygon_options = {
  editable: true,
  clickable: true
}

# points are expected in an array of arrays since technically it can handle multiple polygons
# but we are only using a single polygon
poly_json = [points_array]
polygons = {
  polygons: { data: poly_json.to_json, options: polygon_options }
}

map_view = map_view.merge(polygons)

gmaps(map_view)

The polygon is drawn fine but it is not editable.