浏览代码

Scale POI icon size according to distance from user

master
Adrian Short 11 年前
父节点
当前提交
239f13d288
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. +5
    -1
      app/helpers/posts_helper.rb

+ 5
- 1
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


正在加载...
取消
保存