agenda-libre-ruby/app/views/maps/index.html.haml

31 lines
897 B
Plaintext

%h2
%em.fa.fa-map-marker
=title t '.title'
#map
:javascript
var eventsLayer = new OpenLayers.Layer.Markers("#{t '.events'}");
eventsLayer.setVisibility(true);
var iconSize = new OpenLayers.Size(20, 20);
var iconOffset = new OpenLayers.Pixel(-(iconSize.w/2), -iconSize.h);
- for city in @cities_event
:coffee
eventsLayer.addMarker new OpenLayers.Marker(
new OpenLayers.LonLat(#{city.longitude}, #{city.latitude})
)
:javascript
var lugsLayer = new OpenLayers.Layer.Markers("#{t '.lugs'}");
lugsLayer.setVisibility(true);
var iconSize = new OpenLayers.Size(20, 20);
var iconOffset = new OpenLayers.Pixel(-(iconSize.w/2), -iconSize.h);
- for city in @cities_lug
:coffee
lugsLayer.addMarker new OpenLayers.Marker(
new OpenLayers.LonLat(#{city.longitude}, #{city.latitude})
new OpenLayers.Icon("/assets/team.png", iconSize, iconOffset)
)