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

Polygon options #414

Closed rzimin closed 10 years ago

rzimin commented 10 years ago

Hello,

How to add custom polygon property fields?

For example I can add html property with google maps API as below.

 var poly = new google.maps.Polygon({  
      html: contentString,  
      paths: polyCoords,  
      strokeColor: "#FF0000",  
      strokeOpacity: 0.8,  
      strokeWeight: 2,  
      fillColor: "#FF0000",  
      fillOpacity: 0  
 });

What would be the best option to add such with gmaps2rails?

Thank you.

apneadiving commented 10 years ago

Look in the code: https://github.com/apneadiving/Google-Maps-for-Rails/blob/master/vendor/assets/javascripts/gmaps/objects/handler.coffee#L52

Its the second argument provider_options

Please ask on stackoverflow next time :)