Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## app/models/rental_map.rb [ruby_on_rails]
- class RentalMap
- MAP_NAME = 'RentalMap'
- CSS_ID_NAME = 'RentalMap'
- # ..snip..
- end
- ## app/models/property.rb [ruby_on_rails]
- class Property < ActiveRecord::Base
- # ..snip..
- # javascript_map_marker_code() # {{{
- #
- # Returns a chunk of Javascript that creates a map marker for the property, and adds it to the map.
- #
- # Arguments:
- # None
- #
- # Example Call:
- # Property.find(:first).javascript_map_marker_code
- #
- def javascript_map_marker_code
- "marker#{id} = create_map_marker(#{latitude}, #{longitude}, #{id});
- #{RentalMap::MAP_NAME}.addOverlay(marker#{id});
- "
- end # }}}
- # ..snip..
- end
Add Comment
Please, Sign In to add comment