On Dec 8, 8: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];

This is not an extensible solution.  Geocoding addresses each time
your page loads will eventually break (usually around 10 or so
locations).  See:
http://code.google.com/apis/maps/articles/geocodestrat.html

> </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.

I suspect that you are trying to parse the array before it is
defined.  A link to your map (or an example map that shows the
problem) would help.

-- Larry

-- 
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