Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Fastest Way to Plot Many Markers
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 1 - 25 of 54 - Collapse all  -  Translate all to Translated (View all originals)   Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
atomicBirdsong  
View profile  
 More options Jul 9 2005, 2:26 am
From: "atomicBirdsong" <wjam...@nyc.rr.com>
Date: Fri, 08 Jul 2005 23:26:35 -0700
Local: Sat, Jul 9 2005 2:26 am
Subject: Fastest Way to Plot Many Markers
So I am having trouble with plotting hundreds of markers in a timely
way.  I have more than 400 markers, all set up in XML (whoes quality is
so-so and I am already working on making that nicer).  But the issue is
that the page takes more than 10 seconds to parse the XML and attach
the markers.

I have seen some other sites that are handling almost equal amounts of
points and process in a flash.  So there must be a better way than what
I am doing.  And I have searched through lots of post here and on the
various gmap wiki sites etc.  I have not seen this clearly spelled out,
so I hope there is a genius in the house who can lend some help.

here are some fast examples
(the first being very fast!):
http://www.housingmaps.com/
http://www.folkestonegerald.com/map/

My Map is Here:
http://www.wjamesphoto.com/nontiki/google/testmap.html


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
MAB  
View profile  
 More options Jul 9 2005, 7:24 am
From: "MAB" <mbeck...@gmail.com>
Date: Sat, 09 Jul 2005 04:24:56 -0700
Local: Sat, Jul 9 2005 7:24 am
Subject: Re: Fastest Way to Plot Many Markers
Your site looks great!  Keep up the good work.  I don't think your
issue is the parsing of the xml.  I believe it is the rendering of the
points on the map that takes a while.  If you look at the housing map
that you used in your example, they rarely plot more than 100 points at
the same time.  The system seems to start crawling somewhere around
250-300 points.

A very good example can be found at
http://www.localligence.com/demos/maps/lotsofpoints/map-all.html.  Here
the loading takes a while but you can see the progress.  I have not
tried to replicate this but I believe it is a more elegant solution
than keeping a user waiting.

Best of luck.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ken Robinson  
View profile  
 More options Jul 9 2005, 7:35 am
From: "Ken Robinson" <kenrb...@rbnsn.com>
Date: Sat, 09 Jul 2005 04:35:33 -0700
Local: Sat, Jul 9 2005 7:35 am
Subject: Re: Fastest Way to Plot Many Markers

atomicBirdsong wrote:
> So I am having trouble with plotting hundreds of markers in a timely
> way.  I have more than 400 markers, all set up in XML (whoes quality is
> so-so and I am already working on making that nicer).  But the issue is
> that the page takes more than 10 seconds to parse the XML and attach
> the markers.

I notice you're creating a completely new map type and using that
instead of the default street map. Maybe that's the reason. If use the
default map do the markers appear any faster?

I don't care for your use of a new map type, since it renders the
satilite view useless. (IMHO)

Ken


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
atomicBirdsong  
View profile  
 More options Jul 9 2005, 9:56 am
From: "atomicBirdsong" <wjam...@nyc.rr.com>
Date: Sat, 09 Jul 2005 06:56:35 -0700
Local: Sat, Jul 9 2005 9:56 am
Subject: Re: Fastest Way to Plot Many Markers
Oh - very cool MAB - that looks like a good example too.  I will dig
into it.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
atomicBirdsong  
View profile  
 More options Jul 9 2005, 10:00 am
From: "atomicBirdsong" <wjam...@nyc.rr.com>
Date: Sat, 09 Jul 2005 07:00:05 -0700
Local: Sat, Jul 9 2005 10:00 am
Subject: Re: Fastest Way to Plot Many Markers
Thanks for the feedback Ken - honestly appreciated -  the inability to
use the Satellite view is admittedly a compromise.

Never the less I do know that the images load very rapidly - things
only slowed once the XML was added.  Thanks for looking though.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
inspireme  
View profile  
 More options Jul 9 2005, 10:12 am
From: "inspireme" <eggin...@gmail.com>
Date: Sat, 09 Jul 2005 07:12:41 -0700
Local: Sat, Jul 9 2005 10:12 am
Subject: Re: Fastest Way to Plot Many Markers
My solution was to allow people to click the map (and return a lat/lon
at where the click was, then place these coordinates into a couple of
form boxes) then ask people to choose a radius in miles. Click search.

Using a bit of maths it find all sites located within the radius, loads
up the new map centered to the lat/lon of the previous click, and then
loop through using php placing all the points within 20 miles of the
click. You could also adjust  zoom level depending on radius selected.

You could obviously preselect a radius to make it work from a single
click.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
atomicBirdsong  
View profile  
 More options Jul 9 2005, 10:29 am
From: "atomicBirdsong" <wjam...@nyc.rr.com>
Date: Sat, 09 Jul 2005 07:29:42 -0700
Local: Sat, Jul 9 2005 10:29 am
Subject: Re: Fastest Way to Plot Many Markers
Is there any advantage to having the data already parsed on the server
and just sending it to the client as js variables?  Or something like
that - to get rid of all the processing...or is the time really in the
attaching the markers to the map?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
cgruber@gmail.com  
View profile  
 More options Jul 9 2005, 10:50 am
From: "cgru...@gmail.com" <cgru...@gmail.com>
Date: Sat, 09 Jul 2005 07:50:13 -0700
Local: Sat, Jul 9 2005 10:50 am
Subject: Re: Fastest Way to Plot Many Markers
How are you specifying your own map? I find that very interesting.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
inspireme  
View profile  
 More options Jul 9 2005, 11:23 am
From: "inspireme" <eggin...@gmail.com>
Date: Sat, 09 Jul 2005 08:23:26 -0700
Local: Sat, Jul 9 2005 11:23 am
Subject: Re: Fastest Way to Plot Many Markers
the problem is attaching the markers to the correct coordinates, really
you will struggle to make anything that displays 200-300 markers
workable.

You need to find ways to display relevant data only,  people dont need
to see every point at the same time.

My website is for the UK, it loads the google map centered so the whole
of the UK is viewable.

I will post my site if you want (currently a few problems with errors
in IE so im sorting that out first)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
inspireme  
View profile  
 More options Jul 9 2005, 11:38 am
From: "inspireme" <eggin...@gmail.com>
Date: Sat, 09 Jul 2005 08:38:58 -0700
Local: Sat, Jul 9 2005 11:38 am
Subject: Re: Fastest Way to Plot Many Markers
ok heres basically the radius search code, this example is posting from
a previous page ( hence get vars)

$searchlon=$HTTP_GET_VARS["lon"];
$searchlat=$HTTP_GET_VARS["lat"];
$id=$HTTP_GET_VARS["id"];
$searchradius=$HTTP_GET_VARS["radius"];

 $sql_2 = "select lat,lon,title,link_id from idx_link as z where (SQRT(
(69.1 * (".$searchlat." - z.lat)) * (69.1 * (".$searchlat." - z.lat)) +
(53.0 *(".$searchlon." - z.lon)) * (53.0 *(".$searchlon." - z.lon))) <=
".$searchradius." )";
    $finalResult =  doQueryResult($sql_2);

This then gives me all the relevant lat/lon points and html popup box
information I need to mark on the map.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
atomicBirdsong  
View profile  
 More options Jul 9 2005, 12:41 pm
From: "atomicBirdsong" <wjam...@nyc.rr.com>
Date: Sat, 09 Jul 2005 09:41:38 -0700
Local: Sat, Jul 9 2005 12:41 pm
Subject: Re: Fastest Way to Plot Many Markers
thanks Inspireme.  I was thinking about doing something like this.

Probably would want to tie that to a map repositioning function and
marker caching so you dont reload points already plotted.  I'll have to
look at the API to see if the first is possible.

is using a SQL database faster than using XML?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
inspireme  
View profile  
 More options Jul 9 2005, 3:08 pm
From: "inspireme" <eggin...@gmail.com>
Date: Sat, 09 Jul 2005 12:08:23 -0700
Local: Sat, Jul 9 2005 3:08 pm
Subject: Re: Fastest Way to Plot Many Markers
Using sql is the best because I can limit what is shown using queries.
Gives lots of flexibility and allows me to load less points which is
loads quicker.

Like-for-Like  Its perhaps a little faster than loading the data.xml
file, i havent tested it though.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
crash  
View profile  
 More options Jul 9 2005, 3:14 pm
From: "crash" <ddavid...@360surveillance.com>
Date: Sat, 09 Jul 2005 12:14:30 -0700
Local: Sat, Jul 9 2005 3:14 pm
Subject: Re: Fastest Way to Plot Many Markers
The performance problem appears to stem from the 'AddOverlay' method.
It would make sense if you could add the markers to a collection as you
create them, and then call 'AddOverlay' just once when you are done.
This might allow some time savings, depending on how their code is set
up.

I agree with the poster.  As it currently sits, this is a significant
limitation.  My application will easily require 100 to 200 objects
visible at once, which takes between 1 and 2 minutes to load at present.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
inspireme  
View profile  
 More options Jul 9 2005, 3:50 pm
From: "inspireme" <eggin...@gmail.com>
Date: Sat, 09 Jul 2005 12:50:50 -0700
Local: Sat, Jul 9 2005 3:50 pm
Subject: Re: Fastest Way to Plot Many Markers
ok Heres a few things I have done, they maybe useful for a few to look
at :

1) this is basically grabbing and displaying the point from a database
(simple)
http://www.bigfreeguide.com/camping/detail-penmarlam_caravan_and_camp...

2) the above page has links underneath the map that do a radius search

3) this loads the map from an xml file (every point, painfully slow)
http://www.bigfreeguide.com/camping/loadmaps.php

4) this is an experimental page using some code i kind poster on these
forums provided to do a "zoom" function. I have lots of work to do on
it but hopefully this will replace the above slow map
http://www.bigfreeguide.com/camping/GAPI/livepoint1.htm

the last link *may* only work in firefox - i cant seem to get it to
load the headers and footers on this page in IE without causing errors.
(Even wrapping the code in a function wont work)

Hope this give you some ideas. most works on the radius search i posted
above.

ohh and I also have this other type of map that works along side google
for dialup users
http://www.bigfreeguide.com/camping/GAPI/loadmaps2.php

Its free/$10 :
http://backspace.com/mapapp/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
crash  
View profile  
 More options Jul 9 2005, 4:13 pm
From: "crash" <ddavid...@360surveillance.com>
Date: Sat, 09 Jul 2005 13:13:54 -0700
Local: Sat, Jul 9 2005 4:13 pm
Subject: Re: Fastest Way to Plot Many Markers
A subsequent test seems to confirm that the problem is the 'AddOverlay'
call.  If you display a 500 segment polyline with a single 'AddOverlay'
call it is fast.  If you display 500 individual polylines with an
'AddOverlay' for each one it takes forever.
This makes me think that the speed problem could be eliminated by
adding a collection class for Markers and passing the collection class
into the 'AddOverlay' method.

Thoughts?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
inspireme  
View profile  
 More options Jul 9 2005, 4:18 pm
From: "inspireme" <eggin...@gmail.com>
Date: Sat, 09 Jul 2005 13:18:09 -0700
Local: Sat, Jul 9 2005 4:18 pm
Subject: Re: Fastest Way to Plot Many Markers
sounds great, would it work with each marker having seperate html info
boxes? I havent looked into that greatly as it just worked from the
examples (havent altered it much yet)

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Richard Kagerer  
View profile  
 More options Jul 9 2005, 4:27 pm
From: "Richard Kagerer" <r...@leapbeyond.com>
Date: Sat, 09 Jul 2005 13:27:19 -0700
Local: Sat, Jul 9 2005 4:27 pm
Subject: Re: Fastest Way to Plot Many Markers
Inspireme,

The Flash map looks like a simple, nifty alternative to Google Maps for
maps with excessive waypoint counts. Thanks for the link.

-Richard


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
datarater@gmail.com  
View profile  
 More options Jul 9 2005, 5:27 pm
From: "datara...@gmail.com" <datara...@gmail.com>
Date: Sat, 09 Jul 2005 21:27:36 -0000
Local: Sat, Jul 9 2005 5:27 pm
Subject: Re: Fastest Way to Plot Many Markers
I loved those sites.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
atomicBirdsong  
View profile  
 More options Jul 9 2005, 10:52 pm
From: "atomicBirdsong" <wjam...@nyc.rr.com>
Date: Sat, 09 Jul 2005 19:52:26 -0700
Local: Sat, Jul 9 2005 10:52 pm
Subject: Re: Fastest Way to Plot Many Markers
hmmm....trying MAB's suggestion of putting at least a counter on the
map while it loads, and noticed something interesting.

The way my script is structured I use a for() loop to go through all
the XML, but when I put in the counter, it never changed the visible
text on the window until it was done with all the elements.  But after
doing a little check it was definately changing the DOM element.

In looking at the structure of the provided link by MAB, I noticed the
author structured their XML load as a redundant function call...first
the XML is parsed in an onload function, then there is another function
which only adds one Marker.  The author also uses a time delay between
each call with:       window.setTimeout();

like so, where mapOne adds a Marker:

    if (request.readyState == 4) {
      var xmlDoc = request.responseXML;
      markers = xmlDoc.documentElement.getElementsByTagName("marker");
      window.setTimeout(mapOne,timeOut);
    }

The interesting consequence of this seems to be is that this allows the
visible window to redraw in between each marker load...as there is a
break in the process of adding markers, at this time the screen updates
and the user can also move the map and make clicks.

This seems to be a reverse alternative to the one being pursued by
inspireme and crash who are looking to find a way to add the markers
all at once.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
atomicBirdsong  
View profile  
 More options Jul 10 2005, 12:58 am
From: "atomicBirdsong" <wjam...@nyc.rr.com>
Date: Sat, 09 Jul 2005 21:58:13 -0700
Local: Sun, Jul 10 2005 12:58 am
Subject: Re: Fastest Way to Plot Many Markers
I implemented a loading notice and now load markers in batches of 20
ala the site posted by MAB.  Its definitely better.

But it would be much better if all the markers could be loaded at once
and then the map re-drawn only once -- ala Crash's idea.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lokkju  
View profile  
 More options Jul 14 2005, 9:44 pm
From: "Lokkju" <lok...@gmail.com>
Date: Thu, 14 Jul 2005 18:44:51 -0700
Local: Thurs, Jul 14 2005 9:44 pm
Subject: Re: Fastest Way to Plot Many Markers
Ok, as asked for, a method to load multiple overlays at once.  Simply
pass the function an array of markers (a non-associative array,
please!), and it seems to increase load speed dramatically.  To use,
simply place in a script tag anywhere after you load the Google Maps
API script, and then call it instead of using multiple addOverlay
calls.

take this under consideration:

GMap.prototype.addOverlays=function(a){
        var b=this;
        for (i=0;i<a.length;i++) {
                try {
                        this.overlays.push(a[i]);
                        a[i].initialize(this);
                        a[i].redraw(true);
                } catch(ex) {
                        alert('err: ' + i + ', ' + ex.toString());
                }
        }
        this.reOrderOverlays();

};

Also, if anyone is interested, I have an API addon I have written to
allow USGS Terraserver images to be loaded (as extra maptypes).  In
fact, the structure of it would easily enable anyone to make there own
Map Type extention

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lokkju  
View profile  
 More options Jul 14 2005, 9:52 pm
From: "Lokkju" <lok...@gmail.com>
Date: Thu, 14 Jul 2005 18:52:04 -0700
Local: Thurs, Jul 14 2005 9:52 pm
Subject: Re: Fastest Way to Plot Many Markers
Holy Crap.  I just tested this further.  I loaded 1300 Markers in less
then 20 seconds...  I think this is problem solved...  The map does
move a bit sluggishly, both on panning and zooming, so 1300 is probably
a bit much - but 500 or so seems to have no issues, and is FAST to load.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
atomicBirdsong  
View profile  
 More options Jul 14 2005, 10:16 pm
From: "atomicBirdsong" <wjam...@nyc.rr.com>
Date: Thu, 14 Jul 2005 19:16:04 -0700
Local: Thurs, Jul 14 2005 10:16 pm
Subject: Re: Fastest Way to Plot Many Markers
Lokkju

Interesting - thats your function?
It looks like ;n.prototype.addOverlay()
but with an array loop added...?

although it also looks like you left out adding a click method to your
markers?:
from ;n.prototype.addOverlay():

//-----

                        var b=this;
                        j.addListener(a,"click",function(){j.trigger(b,"click",a)

//-----

1300 in 20 secs is damn fast!  I'll try it out.

Also I've just been combing through version 11 and pulling this stuff
apart to try to find the related .redraw() to suspend the likely
"this.map.div.appendChild" -- guessing here -- that plots a
marker...thinking to suspend it after all markers are appended to the
overlays array....but your report it curious too

if anyone wants to email me to work on this you can at wjames5 -=at=-
nyc.rr.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lokkju  
View profile  
 More options Jul 14 2005, 10:21 pm
From: "Lokkju" <lok...@gmail.com>
Date: Thu, 14 Jul 2005 19:21:34 -0700
Local: Thurs, Jul 14 2005 10:21 pm
Subject: Re: Fastest Way to Plot Many Markers
yes, it is based on the prototype function in the API - that stands to
reason.  As for the click event, I do not see any functional differance
between it being there and not - I always add a click event later, to
pop up an info window, so...

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike  
View profile  
 More options Jul 14 2005, 10:33 pm
From: "Mike" <foofoo...@gmail.com>
Date: Thu, 14 Jul 2005 19:33:54 -0700
Local: Thurs, Jul 14 2005 10:33 pm
Subject: Re: Fastest Way to Plot Many Markers
Nice.
This will make a good start on a prototype extension library to googles
api.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Messages 1 - 25 of 54   Newer >
« Back to Discussions « Newer topic     Older topic »