axyjo/leaflet-rails — pull request #29 by TheMetalCode (2014-06-21 19:33:54+00:00)
Title: Add Marker Icon Options to View Helper

The idea here is to be able to use the view helper to include custom icon options for the markers, like so:

```ruby
house_icon = { name: 'house', icon_url: '/assets/icons/house.png'}
@map = map(
center: {
latlng: [35.133781, -89.981448],
zoom: 13
},
markers: [
{
latlng: [35.1189818, -89.903663],
popup: 'Some dudes house',
icon: house_icon
},
{
latlng: [35.133781, -89.981448],
popup: 'Your present location',
icon: house_icon
}
]
)
```
Reference for Leaflets custom icons [here](http://leafletjs.com/examples/custom-icons.html).

The new code provides either blank strings or empty arrays as defaults for everything except icon_url, because icon_url is the only icon setting that is truly required.

I took care not only to write a few new tests on this, but also tested it in my own leaflets map implementation, so I think this should work well.

Also, the specs are going to throw all kinds of deprecation warnings for RSpec 3.0, so I adjusted the gemspec accordingly. I'd be happy to help with RSpec 3.0 conversion, of course, but I figured that work really belonged in a separate pull request.

Thanks a ton for your work on leaflet-rails, by the way!