Hi,
I have a Rails app with a map. In my database, I have a markets table
with columns: lat, lng, name, address. On the markets/index page, I
simply want to populate the map with all the points from my markets
table (there are few enough that it's not a problem in terms of
clutter etc.).
I have the basic map working fine, but my problem is that I can't
figure out how to dynamically add points from my markets table.
Rails lets me easily format my markets/index action to send data in
xml/json format from the controller, and that's the approach I'm
trying to take.
In the header of my markets/index html page, I also have this:
<script type="text/javascript">
var markets = <%= @markets.to_json %>;
</script>
What I can't figure out is how to properly pull that json data into my
application.js file, and use it to populate my map. Any help or
references to good online resources are much appreciated.
I read your guidelines and unfortunately I don't have a link to give
you right now. But there's really nothing to see at the moment. I've
got a map that renders with controls and I can add a static point or a
static information window, but that's about it. What I really need to
do is take it to the next level and dynamically pull in data from my
database.
Thanks,
Mike
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" 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/google-maps-api?hl=en
-~----------~----~----~----~------~----~------~--~---