> Does anyone have advice on how to correctly
> implement markermanager on my page:
> http://www.greenandtheblue.com/weather/markers_xml_13jun11.html
I reckon a good start would be to examine any javasacript errors
reported, and deal with those.
If you haven't got one, get some kind of script debugger for your
browser.
I'm using Firebug and it says ...
"markersForManager is not a function"
about this line of your code
mgr.addMarkers(markersForManager(10), 8);
Earlier on you defined 'markersForManager' as an array
var markersForManager = [];
but the javascript interpreter looks at
mgr.addMarkers(markersForManager(10), 8);
and will interpret the 'markersForManager(10)' as being a call to a
function called markersForManager and to pass an argument with value
'10'. That's what javascripts does when given a structure like
banana(skin), the round brackets tell it to look for a function.
You don't have a function called markersForManager(), so that's the
error reported.
'markersForManager' with no brackets at all, round or square, gets
interpreted as meaning to refer to some variable of that name, in
pasrticular the _whole_ variable. Which is just what you want - pass
the _whole_ array to your 'mgr'
I'm not sure where your '10' comes from, I don't think you want to
pass markersForManager[10] as that is just one item in the array
On a different issue, you need to re-read the MarkerManager docs.
http://google-maps-utility-library-v3.googlecode.com/svn/tags/markermanager/1.0/docs/examples.html
You want MM to manage which markers are shown on the map for you, so
you have to let it do that. When creating your markers, don't put
them on the map. It's okay to create them without attaching them to
any map. Then when you give the whole bunch to MM it will work out
which ones to show or not.
--
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.