- var obj_type = '<%= type %>';
- var obj_id = <%= id %>;
- var url = "/api/<%= "#{API_VERSION}" %>/<%= type %>/<%= id %>";
- if (obj_type != "node") {
- url += "/full";
- }
- var map = createMap('small_map', {controls: [new OpenLayers.Control.Navigation()]});
- var osm_layer = new OpenLayers.Layer.GML("OSM", url, {format: OpenLayers.Format.OSM, projection: new OpenLayers.Projection("EPSG:4326")});
- osm_layer.events.register("loadend", osm_layer, function() {
- $("loading").innerHTML = "";
- if (this.features.length) {
+ var obj_type = "<%= map.class.name.downcase %>";
+ var obj_id = <%= map.id %>;
+ var url = "/api/<%= "#{API_VERSION}" %>/<%= map.class.name.downcase %>/<%= map.id %>";
+
+ if (obj_type != "node") {
+ url += "/full";
+ }
+
+ var map = createMap("small_map", {
+ controls: [ new OpenLayers.Control.Navigation() ]
+ });
+
+ var osm_layer = new OpenLayers.Layer.GML("OSM", url, {
+ format: OpenLayers.Format.OSM,
+ projection: new OpenLayers.Projection("EPSG:4326")
+ });
+
+ osm_layer.events.register("loadend", osm_layer, function() {
+ $("loading").innerHTML = "";
+
+ if (this.features.length) {