2 //= require leaflet.osm
4 window.onload = function () {
5 var query = (window.location.search || '?').substr(1),
8 query.replace(/([^&=]+)=?([^&]*)(?:&+|$)/g, function(match, key, value) {
9 value = value.split(",");
10 if (value.length == 1)
15 var map = L.map("map");
16 map.attributionControl.setPrefix('');
18 if (!args.layer || args.layer == "mapnik" || args.layer == "osmarender") {
19 new L.OSM.Mapnik().addTo(map);
20 } else if (args.layer == "cyclemap" || args.layer == "cycle map") {
21 new L.OSM.CycleMap().addTo(map);
22 } else if (args.layer == "transportmap") {
23 new L.OSM.TransportMap().addTo(map);
24 } else if (args.layer == "mapquest") {
25 new L.OSM.MapQuestOpen().addTo(map);
29 L.marker(args.marker, {icon: L.icon({
30 iconUrl: <%= asset_path('images/marker-icon.png').to_json %>,
31 iconSize: new L.Point(25, 41),
32 iconAnchor: new L.Point(12, 41),
33 shadowUrl: <%= asset_path('images/marker-shadow.png').to_json %>,
34 shadowSize: new L.Point(41, 41)
39 map.fitBounds([L.latLng(args.bbox[1], args.bbox[0]),
40 L.latLng(args.bbox[3], args.bbox[2])])