3 function getUserIcon(url) {
5 iconUrl: url || <%= asset_path('marker-red.png').to_json %>,
9 shadowUrl: <%= asset_path('images/marker-shadow.png').to_json %>,
14 function addObjectToMap(object, map, options) {
15 if (objectLoader) objectLoader.abort();
16 if (map.objectLayer) map.removeLayer(map.objectLayer);
18 objectLoader = $.ajax({
19 url: OSM.apiUrl(object),
21 success: function (xml) {
22 map.objectLayer = new L.OSM.DataLayer(null, {
30 map.objectLayer.interestingNode = function (node, ways, relations) {
31 if (object.type === "node") {
33 } else if (object.type === "relation") {
34 for (var i = 0; i < relations.length; i++)
35 if (relations[i].members.indexOf(node) != -1)
42 map.objectLayer.addData(xml);
44 if (options.zoom) map.fitBounds(map.objectLayer.getBounds());
45 if (options.callback) options.callback(map.objectLayer.getBounds());
47 map.objectLayer.addTo(map);