1 <%= javascript_include_tag '/openlayers/OpenLayers.js' %>
2 <%= javascript_include_tag '/openlayers/OpenStreetMap.js' %>
3 <%= javascript_include_tag 'map.js' %>
5 <% if map.instance_of? Changeset or (map.instance_of? Node and map.version > 1) or map.visible %>
8 <span id="loading"><%= t 'browse.map.loading' %></span>
9 <a id="area_larger_map" href=""></a>
10 <% unless map.instance_of? Changeset %>
12 <a id="object_larger_map" href=""></a>
15 <%= t 'browse.map.deleted' %>
18 <% if map.instance_of? Changeset or (map.instance_of? Node and map.version > 1) or map.visible %>
19 <script type="text/javascript">
20 OpenLayers.Lang.setCode("<%= I18n.locale.to_s %>");
23 var map = createMap("small_map", {
24 controls: [ new OpenLayers.Control.Navigation() ]
27 <% if map.instance_of? Changeset %>
28 var minlon = <%= map.min_lon / GeoRecord::SCALE.to_f %>;
29 var minlat = <%= map.min_lat / GeoRecord::SCALE.to_f %>;
30 var maxlon = <%= map.max_lon / GeoRecord::SCALE.to_f %>;
31 var maxlat = <%= map.max_lat / GeoRecord::SCALE.to_f %>;
32 var bbox = new OpenLayers.Bounds(minlon, minlat, maxlon, maxlat);
37 $("loading").innerHTML = "";
39 $("area_larger_map").href = '/?minlon='+minlon+'&minlat='+minlat+'&maxlon='+maxlon+'&maxlat='+maxlat+'&box=yes';
40 $("area_larger_map").innerHTML = "<%= t 'browse.map.larger.area' %>";
42 var obj_type = "<%= map.class.name.downcase %>";
43 var obj_id = <%= map.id %>;
44 var obj_version = <%= map.version %>;
45 var obj_visible = <%= map.visible %>;
46 var url = "/api/<%= "#{API_VERSION}" %>/<%= map.class.name.downcase %>/<%= map.id %>";
48 if (obj_type != "node") {
50 } else if (!obj_visible) {
51 var previous_version = obj_version - 1;
52 url += "/" + previous_version;
55 addObjectToMap(url, true, function(extent) {
56 $("loading").innerHTML = "";
59 extent.transform(map.getProjectionObject(), map.displayProjection);
61 $("area_larger_map").href = '/?minlon='+extent.left+'&minlat='+extent.bottom+'&maxlon='+extent.right+'&maxlat='+extent.top;
62 $("area_larger_map").innerHTML = "<%= t 'browse.map.larger.area' %>";
64 <% unless map.instance_of? Changeset %>
65 $("object_larger_map").href = '/?<%= map.class.to_s.downcase %>=<%= map.id %>';
66 $("object_larger_map").innerHTML = "<%= t('browse.map.larger.' + map.class.to_s.downcase) %>";
69 $("small_map").style.display = "none";