I am late to this thread, so if I repeat a question already resolved,
please excuse me.

Perhaps it would be easier to back up, and explain what you hope the
user will see?  I am guessing that you have a collection of cities
(perhaps hard-coded in gmap_loop.js, with name and lat/lng).  Based on
some code passed to your server, you wish to display markers for some,
but not all, of those cities.  So you use PHP code to write .....?
What are you writing?

What page is your PHP code writing to?  Is it writing the gmap_loop.js
page (before it is loaded by easyflat.com.ua)?  Or does it only write
easyflat.com.ua (leaving gmap_loop.js unchanged)?  Are you writing the
"cities" javascript variable inside a script tag in easyflat.com.ua,
hoping to use that variable inside gmap_loop.js?

IF you can manually write the cities Javascript array in
easyflat.com.ua and make it work, then all you need to do is "View
Page Source" to see exactly what your PHP code is writing (because it
must be different than what you are writing manually).  The order you
do things probably doesn't matter; the key would be to get your PHP
code to write exactly what you had been writing manually.  And that's
a PHP question, not a google maps question.

Which is why it will be much easier to get help if you can provide a
link to BOTH a working and non-working version.  (Then it should just
be a matter of looking at the source.  Which we cannot do now.)

Good luck.

- Jeff

On Dec 10, 7:34 am, Futsutsuka <[email protected]> wrote:
> Mistyped: But when it's looped in JS file it gave wrong value. Empty
> variables.
>
> On 10 Грд, 17:33, Futsutsuka <[email protected]> wrote:
>
>
>
>
>
>
>
> > well I wrote an array of names -  var cities = new
> > Array(kiev,kharkov,lvov,odessa);
> > But when it's looped in JS file . As the cities to view in JS file are
> > variables that are set in JS file. And the sequence I believe now is
> > following:
> > 1. The php loads gmap_loop.js
> > 2. gmap_loop.js sets variables with markers and map.
> > 3. php writes array that contains names of the variables to be set in
> > var cities in gmap_loop.js (which is already set).
> > 4. map is loaded.
>
> > what if I change the sequence to:
> > 1. php writes to browser a JS function loadArray() that generates an
> > array with cities.
> > 2. php loads gmap_loop.js.
> > 3. gmap_loop.js sets variables with markers calls function loadArray
> > that returns array cities and loads map
>
> > Will it work?
>
> > On 10 Грд, 16:56, Rossko <[email protected]> wrote:
>
> > > > Than the question is... how to tell to array cities in gmap_loop.js
> > > > that it should collect only those variable that are equal to names of
> > > > cities defined in PHP array $clean_cities?
>
> > > I think you want to load a whole set of cities in your javascript
> > > file, but only display some of them according to some selection values
> > > passed from php??
>
> > > You might write an array of names or some other ID into your main
> > > page, then have your javascript loop through your possibles and
> > > display ones that match.
> > > Or you might pass names or some other ID via the page URL querystring,
> > > and so not modify the page every time (allowing user's browsers to use
> > > their cache effectively).

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