if (args.marker) {
L.marker(args.marker.split(','), {icon: L.icon({
- iconUrl: <%= asset_path('images/marker-icon.png').to_json %>,
+ iconUrl: OSM.MARKER_ICON,
iconSize: new L.Point(25, 41),
iconAnchor: new L.Point(12, 41),
- shadowUrl: <%= asset_path('images/marker-shadow.png').to_json %>,
+ shadowUrl: OSM.MARKER_SHADOW,
shadowSize: new L.Point(41, 41)
})}).addTo(map);
}
});
var endpoints = [
- Endpoint($("input[name='route_from']"), <%= asset_path('marker-green.png').to_json %>),
- Endpoint($("input[name='route_to']"), <%= asset_path('marker-red.png').to_json %>)
+ Endpoint($("input[name='route_from']"), OSM.MARKER_GREEN),
+ Endpoint($("input[name='route_to']"), OSM.MARKER_RED)
];
function Endpoint(input, iconUrl) {
iconSize: [25, 41],
iconAnchor: [12, 41],
popupAnchor: [1, -34],
- shadowUrl: <%= asset_path('images/marker-shadow.png').to_json %>,
+ shadowUrl: OSM.MARKER_SHADOW,
shadowSize: [41, 41]
}),
draggable: true
endpoint.awaitingGeocode = true;
- $.getJSON(document.location.protocol + '<%= NOMINATIM_URL %>search?q=' + encodeURIComponent(endpoint.value) + '&format=json', function (json) {
+ $.getJSON(document.location.protocol + OSM.NOMINATIM_URL + 'search?q=' + encodeURIComponent(endpoint.value) + '&format=json', function (json) {
endpoint.awaitingGeocode = false;
endpoint.hasGeocode = true;
if (json.length == 0) {
var noteIcons = {
"new": L.icon({
- iconUrl: "<%= image_path 'new_note_marker.png' %>",
+ iconUrl: OSM.NEW_NOTE_MARKER,
iconSize: [25, 40],
iconAnchor: [12, 40]
}),
"open": L.icon({
- iconUrl: "<%= image_path 'open_note_marker.png' %>",
+ iconUrl: OSM.OPEN_NOTE_MARKER,
iconSize: [25, 40],
iconAnchor: [12, 40]
}),
"closed": L.icon({
- iconUrl: "<%= image_path 'closed_note_marker.png' %>",
+ iconUrl: OSM.CLOSED_NOTE_MARKER,
iconSize: [25, 40],
iconAnchor: [12, 40]
})
var noteIcons = {
"new": L.icon({
- iconUrl: "<%= image_path('new_note_marker.png') %>",
+ iconUrl: OSM.NEW_NOTE_MARKER,
iconSize: [25, 40],
iconAnchor: [12, 40]
}),
"open": L.icon({
- iconUrl: "<%= image_path('open_note_marker.png') %>",
+ iconUrl: OSM.OPEN_NOTE_MARKER,
iconSize: [25, 40],
iconAnchor: [12, 40]
}),
"closed": L.icon({
- iconUrl: "<%= image_path('closed_note_marker.png') %>",
+ iconUrl: OSM.CLOSED_NOTE_MARKER,
iconSize: [25, 40],
iconAnchor: [12, 40]
})
var noteIcons = {
"new": L.icon({
- iconUrl: "<%= image_path 'new_note_marker.png' %>",
+ iconUrl: OSM.NEW_NOTE_MARKER,
iconSize: [25, 40],
iconAnchor: [12, 40]
}),
"open": L.icon({
- iconUrl: "<%= image_path 'open_note_marker.png' %>",
+ iconUrl: OSM.OPEN_NOTE_MARKER,
iconSize: [25, 40],
iconAnchor: [12, 40]
}),
"closed": L.icon({
- iconUrl: "<%= image_path 'closed_note_marker.png' %>",
+ iconUrl: OSM.CLOSED_NOTE_MARKER,
iconSize: [25, 40],
iconAnchor: [12, 40]
})
L.Icon.Default.imagePath = "/images";
L.Icon.Default.imageUrls = {
- "/images/marker-icon.png": "<%= asset_path("images/marker-icon.png") %>",
- "/images/marker-icon-2x.png": "<%= asset_path("images/marker-icon-2x.png") %>",
- "/images/marker-shadow.png": "<%= asset_path("images/marker-shadow.png") %>"
+ "/images/marker-icon.png": OSM.MARKER_ICON,
+ "/images/marker-icon-2x.png": OSM.MARKER_ICON_2X,
+ "/images/marker-shadow.png": OSM.MARKER_SHADOW
};
L.extend(L.Icon.Default.prototype, {
function getUserIcon(url) {
return L.icon({
- iconUrl: url || <%= asset_path('marker-red.png').to_json %>,
+ iconUrl: url || OSM.MARKER_RED,
iconSize: [25, 41],
iconAnchor: [12, 41],
popupAnchor: [1, -34],
- shadowUrl: <%= asset_path('images/marker-shadow.png').to_json %>,
+ shadowUrl: OSM.MARKER_SHADOW,
shadowSize: [41, 41]
});
}
STATUS: <%= STATUS.to_json %>,
MAX_NOTE_REQUEST_AREA: <%= MAX_NOTE_REQUEST_AREA.to_json %>,
OVERPASS_URL: <%= OVERPASS_URL.to_json %>,
+ NOMINATIM_URL: <%= NOMINATIM_URL.to_json %>,
+
+ MARKER_GREEN: <%= image_path("marker-green.png").to_json %>,
+ MARKER_RED: <%= image_path("marker-red.png").to_json %>,
+ MARKER_ICON: <%= image_path("marker-icon.png").to_json %>,
+ MARKER_ICON_2X: <%= image_path("marker-icon-2x.png").to_json %>,
+ MARKER_SHADOW: <%= image_path("marker-shadow.png").to_json %>,
+
+ NEW_NOTE_MARKER: <%= image_path("new_note_marker.png").to_json %>,
+ OPEN_NOTE_MARKER: <%= image_path("open_note_marker.png").to_json %>,
+ CLOSED_NOTE_MARKER: <%= image_path("closed_note_marker.png").to_json %>,
apiUrl: function (object) {
var url = "/api/" + OSM.API_VERSION + "/" + object.type + "/" + object.id;