건물, 두 가지 가능성이 짧은 가지 방법이 마음에 와서 :
def gmaps4rails_marker_picture
{
"picture" => "/images/" + self.category + ".png",
"width" => 32, #beware to resize your pictures properly
"height" => 32 #beware to resize your pictures properly
}
end
:
def gmaps4rails_marker_picture
{
"picture" => self.image_path, # image_path column has to contain something like '/assets/my_pic.jpg'.
"width" => 32, #beware to resize your pictures properly
"height" => 32 #beware to resize your pictures properly
}
end
이 경우, 우리는 그림의 이름으로 범주 열을 재사용 : 일반
지금 누락 된 유일한 것은 스프라이트를 사용하는 방법입니다. 그러나 그것은 불가능할 것입니다.
출처
2011-02-18 17:04:23
jmk
잘 완료 jmk;) – apneadiving