function init(){
var centre = new OpenLayers.LonLat(<%= lon %>, <%= lat %>);
+ <% if params[:scale].to_f > 0 then -%>
+ var zoom = <%= scale_to_zoom params[:scale] %>;
+ <% else -%>
var zoom = <%= zoom %>;
-
- <% if params['scale'] and params['scale'].length > 0 then %>
- zoom = scaleToZoom(<%= params['scale'].to_f() %>);
- <% end %>
+ <% end -%>
var map = createMap("map");
<% nearest = @user.nearby - friends %>
var near_icon = OpenLayers.Marker.defaultIcon();
- near_icon.url = OpenLayers.Util.getImagesLocation() + "marker-green.png";
+ near_icon.url = OpenLayers.Util.getImageLocation("marker-green.png");
<% nearest.each do |u| %>
addMarkerToMap(new OpenLayers.LonLat(
<%= u.home_lon %>, <%= u.home_lat %>), near_icon.clone(),
<% end %>
var friend_icon = OpenLayers.Marker.defaultIcon();
- friend_icon.url = OpenLayers.Util.getImagesLocation() + "marker-blue.png";
+ friend_icon.url = OpenLayers.Util.getImageLocation("marker-blue.png");
<% friends.each do |u| %>
addMarkerToMap(new OpenLayers.LonLat(
<%= u.home_lon %>, <%= u.home_lat %>), friend_icon.clone(),