X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/716262f211a8983a4272eabf3fdba9877b068b65..ec1667fc093976cb9a69e5aba675ee4281d7ff64:/app/views/user/_map.html.erb?ds=sidebyside diff --git a/app/views/user/_map.html.erb b/app/views/user/_map.html.erb index 6f192931f..2d886527c 100644 --- a/app/views/user/_map.html.erb +++ b/app/views/user/_map.html.erb @@ -24,11 +24,11 @@ end 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"); @@ -52,7 +52,7 @@ end <% 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(), @@ -61,7 +61,7 @@ end <% 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(),