Well, you probably know how to read from the database, etc. So, dealing with getting the values into your page, one way is to emit script when your (presumed PHP) page is built, that look like this:
<script type="text/javascript">var lat=<?php=$lat?></script> So you start with a PHP variable '$lat' and end up creating a javascript variable 'lat' when the page loads. Another way would be to turn that around and make AJAX calls back to your server to pull down the value after the page is loaded. There's a jMap plugin at jquery.com which deals with many of the basic functions of creating a Google map. It may be of use, or the code may suffice as examples to work from. On Nov 16, 9:38 am, Conor <[EMAIL PROTECTED]> wrote: > Hello everybody > > In the simple map > demohttp://code.google.com/apis/maps/documentation/examples/map-simple.html > The GLatLng (,) values are static values (37.4419,-122.1419 as per the > code snippet below). > > Can anybody point me to a tutorial or demo where lng and lat co-ords > are read on the fly from a MySQL database and written into the > map.setCenter(new GLatLng) as a variable. They may appear , for > example, as > > map.setCenter(new GLatLng($lat,$lng) where $countrycode=ie > > I have a number of country templates on my site which generate > content on the fly based on the country code and want to generate > country-specific maps on the fly from the country database rather than > hard code the lat, lng into each template. > > My country database is such > > tblMyMaps > ------------------------------------------------------ > countrycode | country | lat | lng | > ------------------------------------------------------ > ie | ireland | 53.6000 | -6.33 > fr | france | 52.6000 | 3.33 > gb | Great Britain | 55.0000 | 0.0000 > us | united states | 38.8888 |-77.000 > > thanks in advance > Conor --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
