<%= javascript_include_tag '/openlayers/OpenLayers.js' %>
<%= javascript_include_tag '/openlayers/OpenStreetMap.js' %>
<%= javascript_include_tag 'map.js' %>
-<div id="small_map" style="width:250px; height: 300px; border: solid 1px black">
-</div>
-<span id="loading">Loading...</span>
-<a id="larger_map" href=""></a>
+<td align="right">
+ <% if map.visible %>
+ <div id="small_map" style="width:250px; height: 300px; border: solid 1px black">
+ </div>
+ <span id="loading">Loading...</span>
+ <a id="larger_map" href=""></a>
+ <% else %>
+ Deleted
+ <% end %>
+</td>
<script type="text/javascript">
function init() {
- var obj_type = "<%= type %>";
- var obj_id = <%= id %>;
- var url = "/api/<%= "#{API_VERSION}" %>/<%= type %>/<%= id %>";
+ 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";
or
<%= link_to "view history", :action => "node_history" %>
</td>
- <td align="right">
- <% if @node.visible %>
- <%= render :partial => "map", :locals => { :type => "node", :id => @node.id } %>
- <% else %>
- Deleted
- <% end %>
- </td>
+ <%= render :partial => "map", :object => @node %>
</tr>
</table>
or
<%= link_to "view details", :action => "node" %>
</td>
- <td align="right">
- <% if @node.visible %>
- <%= render :partial => "map", :locals => { :type => "node", :id => @node.id } %>
- <% else %>
- Deleted
- <% end %>
- </td>
+ <%= render :partial => "map", :object => @node %>
</tr>
</table>
or
<%= link_to "view history", :action => "relation_history" %>
</td>
- <td align="right">
- <% if @relation.visible %>
- <%= render :partial => "map", :locals => { :type => "relation", :id => @relation.id } %>
- <% else %>
- Deleted
- <% end %>
- </td>
+ <%= render :partial => "map", :object => @relation %>
</tr>
</table>
or
<%= link_to "view details", :action => "relation" %>
</td>
- <td align="right">
- <% if @relation.visible %>
- <%= render :partial => "map", :locals => { :type => "relation", :id => @relation.id } %>
- <% else %>
- Deleted
- <% end %>
- </td>
+ <%= render :partial => "map", :object => @relation %>
</tr>
</table>
or
<%= link_to "view history", :action => "way_history" %>
</td>
- <td align="right">
- <% if @way.visible %>
- <%= render :partial => "map", :locals => { :type => "way", :id => @way.id } %>
- <% else %>
- Deleted
- <% end %>
- </td>
+ <%= render :partial => "map", :object => @way %>
</tr>
</table>
or
<%= link_to "view details", :action => "way" %>
</td>
- <td align="right">
- <% if @way.visible %>
- <%= render :partial => "map", :locals => { :type => "way", :id => @way.id } %>
- <% else %>
- Deleted
- <% end %>
- </td>
+ <%= render :partial => "map", :object => @way %>
</tr>
</table>