Hi
I'm not sure exactly what you're doing with the data, but it sounds
like your main problem is getting a php/msql array into a format that
javascript can use - is that right?
If so, the trick is to look into using JSON. Do a search on php data
to javascript and you will find examples, but the basic way is to use
json_encode to convert the php array into JSON. Then pickup the JSON
encoded variable in your javascript and convert to a javascript JSON
object. You can parse JSON with JSON.parse if the browser supports it,
or use something like jquery which has a JSON parser.
Hope that is what you wanted.
...stu

On Dec 9, 5:25 am, Futsutsuka <[email protected]> wrote:
> Hi there,
>
> need you help.
> I have a blog .
> I have a gmap.js file that creates a google map with markermanager
> code inside. And I have a markermanager_packed.js from google
> library.
> Both are included in html file index.php generated by php.
> Each post in blog has a variable with city name that is collected to
> an array $cities.
> the code in gmap.js uses array cities:
>         google.maps.event.addListener(mgr, 'loaded', function() {
> // These markers will only be visible between zoom level 1 and 7
>         mgr.addMarkers(cities, 1, 9);
> // These markers will be visible at zoom level 6 and deeper
>         mgr.addMarkers(dotss, 10);
> // Making the MarkerManager add the markers to the map
>         mgr.refresh();
>         });
>
> My php code in html generates and array
>
> <script>
> var cities = [kiev, odessa, donetsk, kharkov, dnepropetrovsk,
> zaporozhye, lvov];
> </script>
>
> but the js code does not recognize it and does not create markers.
> If I write same array inside of gmap.js - everything works perfectly.
>
> Thank you in advance for your help.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.

Reply via email to