From 239f13d288248b14c4ee3376491a30882fde12d6 Mon Sep 17 00:00:00 2001 From: Adrian Short Date: Tue, 7 May 2013 11:31:55 +0100 Subject: [PATCH] Scale POI icon size according to distance from user --- app/helpers/posts_helper.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/helpers/posts_helper.rb b/app/helpers/posts_helper.rb index 0874493..0540b99 100644 --- a/app/helpers/posts_helper.rb +++ b/app/helpers/posts_helper.rb @@ -8,6 +8,10 @@ module PostsHelper image_url = subscription.layer.icon_url end + scale = 1.0 + scale = 2.0 if post.distance < 50 + scale = post.distance / 1000 if post.distance > 1000 + res = { :id => post.id, :imageURL => image_url, @@ -50,7 +54,7 @@ module PostsHelper :angle => 0 }, :translate => { :x => 0, :y => -0.075, :z => ENV['APOLLO_TRANSLATE_Z'] || 1.75 }, - :scale => 1.0 + :scale => scale } end res