ruby on rails - Different Markers in Google Maps with gmaps4rails -
with gmaps4rails there way define custom marker. same 1 shown each database entry.
how show different marker each database entry, in google latitude? preferably through own database column or through sprite, if there pictures categories/groups , not individual users.
building on apneadivings answer, 2 possibly shorter ways come mind:
generic:
def gmaps4rails_marker_picture { "picture" => self.image_path, # image_path column has contain '/assets/my_pic.jpg'. "width" => 32, #beware resize pictures "height" => 32 #beware resize pictures } end
in case, reuse category column name picture:
def gmaps4rails_marker_picture { "picture" => "/images/" + self.category + ".png", "width" => 32, #beware resize pictures "height" => 32 #beware resize pictures } end
the thing missing now, way use sprites. thats impossible.
Comments
Post a Comment