Browse Source

Scale POI icon size according to distance from user

master
Adrian Short 11 years ago
parent
commit
239f13d288
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      app/helpers/posts_helper.rb

+ 5
- 1
app/helpers/posts_helper.rb View File

@@ -8,6 +8,10 @@ module PostsHelper
image_url = subscription.layer.icon_url image_url = subscription.layer.icon_url
end end


scale = 1.0
scale = 2.0 if post.distance < 50
scale = post.distance / 1000 if post.distance > 1000

res = { res = {
:id => post.id, :id => post.id,
:imageURL => image_url, :imageURL => image_url,
@@ -50,7 +54,7 @@ module PostsHelper
:angle => 0 :angle => 0
}, },
:translate => { :x => 0, :y => -0.075, :z => ENV['APOLLO_TRANSLATE_Z'] || 1.75 }, :translate => { :x => 0, :y => -0.075, :z => ENV['APOLLO_TRANSLATE_Z'] || 1.75 },
:scale => 1.0
:scale => scale
} }
end end
res res


Loading…
Cancel
Save