-function getMapBaseLayerId(map) {
- for (var i in map._layers) { // TODO: map.eachLayer
- var layer = map._layers[i];
- if (layer.options && layer.options.keyid) {
- return layer.options.keyid;
- }
- }
-}
-
-function getMapLayers(map) {
- var layerConfig = '';
- for (var i in map._layers) { // TODO: map.eachLayer
- var layer = map._layers[i];
- if (layer.options && layer.options.code) {
- layerConfig += layer.options.code;
- }
+ return page;
+ };
+
+ var history = OSM.History(map);
+
+ OSM.router = OSM.Router(map, {
+ "/": OSM.Index(map),
+ "/search": OSM.Search(map),
+ "/export": OSM.Export(map),
+ "/note/new": OSM.NewNote(map),
+ "/history/friends": history,
+ "/history/nearby": history,
+ "/history": history,
+ "/user/:display_name/history": history,
+ "/note/:id": OSM.Note(map),
+ "/node/:id(/history)": OSM.Browse(map, 'node'),
+ "/way/:id(/history)": OSM.Browse(map, 'way'),
+ "/relation/:id(/history)": OSM.Browse(map, 'relation'),
+ "/changeset/:id": OSM.Browse(map, 'changeset'),
+ "/query": OSM.Query(map)
+ });
+
+ if (OSM.preferred_editor == "remote" && document.location.pathname == "/edit") {
+ remoteEditHandler(map.getBounds(), params.object);
+ OSM.router.setCurrentPath("/");