On Jun 30, 6:19 pm, jayjayc <[email protected]> wrote:
> doh, sorry about that.  I forgot the icon wasnt in the same directory.
>
> I changed it.

When setMarkers calls doGeocode it looks like the arguments are being
treated like strings:
doGeocode(2,1 amana dr johnston ri,1e)

iter+2=22

and since 22 > 14, the mgr.addMarkers/mgr.refresh/grayOut(false)
starts happening each time doGeocode is called after that.

iter=parseInt(iter);

at the begining of doGeocode fixes it for me.

  -- Larry



>
> On Jun 30, 5:55 pm, "[email protected]" <[email protected]>
> wrote:
>
>
>
> > On Jun 30, 12:19 pm, jayjayc <[email protected]> wrote:
>
> > > In the current version of the code, should the variable 'iter' be
> > > local to each instance of doGeocode, which in turn should make it
> > > local to each call back?
>
> > > If so, why would mgr.refresh be called multiple times?
>
> > > If you load my page with several points you can see the map is
> > > refreshed multiple times.
>
> > I don't see that.  I do see a athentication dialog for
> > crm.advancedtelesystems.com asking for a username and password though.
>
> >   -- Larry
>
> > >http://sharepoint.advancedtelesystems.com/public/Downloads/MapIntegra...
>
> > > On Jun 30, 7:28 am, jayjayc <[email protected]> wrote:
>
> > > > Thanks,
> > > > I will try that.
>
> > > > On Jun 30, 12:03 am, "[email protected]" <[email protected]>
> > > > wrote:
>
> > > > > On Jun 29, 8:31 pm, jayjayc <[email protected]> wrote:
>
> > > > > > I have updated the code to add some more features, and to make it 
> > > > > > more
> > > > > > reliable.  The geocoder now runs in a seperate function with local
> > > > > > variables, so now I can accuratly label the tool tips for each 
> > > > > > marker.
>
> > > > > > The problem I have now is an expected one, when trying to map 
> > > > > > multiple
> > > > > > points (>5) occasionally some of the markers do not display.
>
> > > > > > For instance, if you go to the follow page and keep hitting refresh,
> > > > > > sometimes some of the points will not 
> > > > > > display:http://sharepoint.advancedtelesystems.com/public/Downloads/MapIntegra...
> > > > > > title&address1=5 institute rd worcester ma&title1=test title
> > > > > > 1&address2=10 teakwood dr coventry ri&title2=test title2&address3=92
> > > > > > broad st providence ri&title3=test title 3&address4=7 tiogue ave
> > > > > > coventry ri&title4=test title 4
>
> > > > > > Since performance is not really a factor here, is there something I
> > > > > > can do to ensure that all the points load even if it takes several
> > > > > > seconds?
>
> > > > > > I understand the limitation with the geocoder, can someone help
>
> > > > > You need to add error handling to the geocoder.  The .getLatLng method
> > > > > doesn't return and error code, it returns null and doesn't tell you
> > > > > why. The .getLocations method will return multiple locations (the
> > > > > first of which is the one that would have been returned by .getLatLng)
> > > > > and an error code.  If you get a TOO_MANY_QUERIES error code, delay
> > > > > for some period of time, then try again.  A couple of examples from
> > > > > Mike Williams' tutorial:
> > > > > Part 16 Geocoding with error handlinghttp://econym.org.uk/gmap/geo.htm
> > > > > and
> > > > > Part 17 Geocoding multiple 
> > > > > addresseshttp://econym.org.uk/gmap/geomulti.htm
>
> > > > >    -- Larry
>
> > > > > > On Jun 29, 4:33 pm, jayjayc <[email protected]> wrote:
>
> > > > > > > Thank you all for the replys.
>
> > > > > > > I updated the code to include a check to verify the last point has
> > > > > > > been coded, as suggested by Andrew.  It appears to be working.  I 
> > > > > > > have
> > > > > > > only tested it with 6 locations, and it is working.  I may 
> > > > > > > include a
> > > > > > > little message that says something like 'points loading'.
>
> > > > > > > I am aware that this is not the best method for a large number of
> > > > > > > points. I plan on adding some code that will cache the long and 
> > > > > > > lats
> > > > > > > for future use.  Currently the most this would need to handle is
> > > > > > > around 15.  I plan to use the HTTP geocoder to load the position
> > > > > > > information of a site the first time a user opens the database 
> > > > > > > entry.
> > > > > > > This should put off the load over time.  Unfortunately I dont 
> > > > > > > really
> > > > > > > know how to use JSON information, but I will eventually find out.
>
> > > > > > > On Jun 29, 3:29 pm, Andrew C Leach <[email protected]> wrote:
>
> > > > > > > > On 29 June 2010 19:31, jayjayc <[email protected]> 
> > > > > > > > wrote:
>
> > > > > > > > > I am trying to geocode a couple of addresses passed by a url 
> > > > > > > > > and use
> > > > > > > > > the MarkerManager to display them.
>
> > > > > > > > > My map will center around the location, but will not place the
> > > > > > > > > marker(s).
>
> > > > > > > > > Here is a copy with a single address as an example:
> > > > > > > > >http://sharepoint.advancedtelesystems.com/public/Downloads/MapIntegra...
>
> > > > > > > > This is because the geocoder is asynchronous.
>
> > > > > > > > The map is centred because the callback function does that when 
> > > > > > > > it
> > > > > > > > gets the point and pushes the marker on to the array.
>
> > > > > > > > However, the "batch" array is added to the marker manager 
> > > > > > > > before the
> > > > > > > > callback function has been called, so at that point it's empty. 
> > > > > > > > When
> > > > > > > > the geocode result is returned, the map is centred and the 
> > > > > > > > marker is
> > > > > > > > pushed on to the array; but then nothing else happens to the 
> > > > > > > > array.
>
> > > > > > > > You need to ensure that everything which needs to happen to 
> > > > > > > > geocoder
> > > > > > > > data happens within the callback function.
>
> > > > > > > > Since you know the length of arr2, you could include a test in 
> > > > > > > > your
> > > > > > > > loop and only action the centring and marker-adding when you're 
> > > > > > > > done:
>
> > > > > > > > if (i==arr2.length-1) {
> > > > > > > >   gmap.setCenter(point);
> > > > > > > >   mgr.addMarkers(batch, 13);
> > > > > > > >   mgr.refresh();
> > > > > > > >   }
>
> > > > > > > > ...but all that needs to go into the callback function, so 
> > > > > > > > every time
> > > > > > > > a result is processed, the code asks "Is this the last one to 
> > > > > > > > come
> > > > > > > > back?" and finishes the map if it is.- Hide quoted text -
>
> > > > > > > - Show quoted text -- Hide quoted text -
>
> > > > > > - Show quoted text -- Hide quoted text -
>
> > > > > - Show quoted text -- Hide quoted text -
>
> > > > > - Show quoted text -- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -

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

Reply via email to