-$(document).ready(function () {
+function initializeExport(map) {
$("#exportanchor").click(function (e) {
$.ajax({ url: $(this).data('url'), success: function (sidebarHtml) {
startExport(sidebarHtml);
openSidebar();
- if (getMapBaseLayerId() == "mapnik") {
+ if (getMapBaseLayerId(map) == "mapnik") {
$("#format_mapnik").prop("checked", true);
}
function htmlUrlChanged() {
var bounds = getBounds();
- var layerName = getMapBaseLayerId();
+ var layerName = getMapBaseLayerId(map);
var url = "http://" + OSM.SERVER_URL + "/export/embed.html?bbox=" + bounds.toBBoxString() + "&layer=" + layerName;
var markerUrl = "";
var zoom = map.getBoundsZoom(bounds);
- var layers = getMapLayers();
+ var layers = getMapLayers(map);
var text = I18n.t('export.start_rjs.view_larger_map');
var escaped = [];
validateControls();
}
}
-});
+}