Thanks for help me.
Here is the solution:
on hobo-root\app\views\taglibs\application.dryml
...
...
...
<def tag="google-map" attrs="id, ne-lat, ne-long, width, height">
<% @map = GMap.new(id)
@map.control_init(:large_map => true,:map_type => true)
@map.center_zoom_init([ne_lat,ne_long],16) %>
<do param='default'/>
<%= @map.div(:width => width, :height => height) %>
<%= @map.to_html %>
</def>
<def tag="marker" attrs="lat, long, title, info">
<% @map.overlay_init(GMarker.new([lat,long],:title =>
title, :info_window => info)) %>
</def>
...
...
hobo-root\app\views\front\index.dryml
<page title="Home">
<append-scripts:>
<%= GMap.header %>
</append-scripts:>
<top_page_nav: replace/>
<body: class="front-page"/>
...
...
...
<% @test = Place.all -%>
...
...
<google-map id="sites" ne-lat="-22.705805" ne-long="-46.986208"
width="100%" height="500">
<repeat with="&@test">
<marker lat="&this.latitude" long="&this.longitude"
title=Places" info="&this.name + '<br/>' "/>
<br/>
</repeat>
</google-map>
...
...
...
On Nov 16, 3:09 pm, kevinpfromnm <[email protected]> wrote:
> Pretty much same as elsewhere, you set a variable with the result of a
> Model.find. Trick for what you're after will be matching up with what
> google maps expects. Dean posted a recipe awhile
> back,http://cookbook.hobocentral.net/recipes/50-integrating-google-maps-wi...
> but I can't speak to accuracy as I haven't implemented it personally.
> Good luck.
>
> On Nov 16, 6:41 am, Pedro <[email protected]> wrote:
>
>
>
>
>
>
>
> > Hi,
>
> > I need to display a google map on front/index page, with the places
> > (Place is a model) on it. So I dont know how to get Place.latitude
> > and Place.longitude to show it on the map. The question is, how to get
> > a model data on index page?
>
> > Thanks
--
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/hobousers?hl=en.