News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Looking for help to integrate GOOGLE MAPS+SMF **Demo available

Started by Ride, August 18, 2005, 01:49:21 PM

Previous topic - Next topic

Tony Reid

LOL

Hmmm... ok on a serious note.... perhaps it needs to be done slightly differently.
Maybe showing 10k at a time is overkill.

Is it possible to add to the map dynamically? by that I mean just zooming in and drawing the pins for the visible area? much like videogames do?


Tony Reid

TLM

#41
I dunno yet, might be worth looking into... btw the max number I would ever do at one time would probally be 1k users.  Takes FF about a min and a half to load it, but it load the page.  As for google earth, it can take the whole load of 10k but its not pretty, so would say 2-5k at end user descression...


-rw-r--r--   1 root   root   7.1M Sep  6 10:45 10kUsers
-rw-r--r--   1 root   root   737K Sep  6 10:50 1kUsers
-rw-r--r--   1 root   root   1.5M Sep  6 10:50 2kUsers
-rw-r--r--   1 root   root   2.2M Sep  6 10:49 3kUsers
-rw-r--r--   1 root   root   2.9M Sep  6 10:48 4kUsers
-rw-r--r--   1 root   root   3.6M Sep  6 10:48 5kUsers
-rw-r--r--   1 root   root   4.3M Sep  6 10:47 6kUsers
-rw-r--r--   1 root   root   5.0M Sep  6 10:47 7kUsers
-rw-r--r--   1 root   root   5.7M Sep  6 10:47 8kUsers
-rw-r--r--   1 root   root   6.4M Sep  6 10:46 9kUsers
-rw-r--r--   1 root   root   4.0M Sep  6 10:45 GE10kUsers
-rw-r--r--   1 root   root   402K Sep  6 10:50 GE1kUsers
-rw-r--r--   1 root   root   802K Sep  6 10:50 GE2kUsers
-rw-r--r--   1 root   root   1.2M Sep  6 10:49 GE3kUsers
-rw-r--r--   1 root   root   1.6M Sep  6 10:48 GE4kUsers
-rw-r--r--   1 root   root   2.0M Sep  6 10:48 GE5kUsers
-rw-r--r--   1 root   root   2.4M Sep  6 10:47 GE6kUsers
-rw-r--r--   1 root   root   2.8M Sep  6 10:47 GE7kUsers
-rw-r--r--   1 root   root   3.2M Sep  6 10:47 GE8kUsers
-rw-r--r--   1 root   root   3.6M Sep  6 10:46 GE9kUsers


Incase your wondering the files sizes as the users decreased in number...

TLM

The only problem with streaming in the points to what the user is viewing if possible would be what if there zoomed out to see the world map? How many and who gets shown there?

Tony Reid

Maybe postcode and surrounding areas is the better option? or doing it by so many points long/lat?

Members would then be able to use it as a tool - rather than a 'wow look at the thousands of pretty pins'  ;D

Im sure it would have more practical use that way... otherwise looking at an image of all members would be a waste of resources - even though it might look good.

I guess it could be drawn offline and ftp'd as a non interactive image once a month/week for those that want to see how the whole memberbase spreads out across the world?

Maybe Im talking gibberish :)

Tony Reid

TLM

#44
Here is an idea, use postalcode for over 1k users, bound to be a few repeats, and list them in a bubble per postalcode, and if who is viewing wants to take a closer look, can click a link in the bubble which will zoom in on area/plot pins for a predetermined area around the center?

*edit* think we just both thought of this at the same time, just one of us is a slow typer */edit*

As for drawing every pin on the map and making it a static image, not sure how to go about that one yet...

Tony Reid

Yep - I say go with that... and perhaps let the admins set how many pins to display at a time?

It certainly makes much better sense and better use of resources.

sounds like a plan :)

Tony Reid

TLM

Alrighty, I will get on that, may not get that feature done before I have to leave for class/an appointment this afternoon.

Ride

I like the ability for users to place them pin.  That way it's up to them how accurate they want to be with where they live.  I know for a fact it is possible to dynamically load the info but have no idea how.

vdubbia

#48
a different app, but check out www.clustrmaps.com to see how they address multiple 'pins' in close proximity.

You can see it in action on my blog: www.vertiblog.com in the upper right hand corner.

Google maps is the way to go, though, and I think to represent every user might in fact be overkill unless you can limit it to the state/province/local level.  Maybe have a different color pin to represent density?

They do create a static image and update it for retrieval daily.

vdubbia

Quote from: Ride on September 06, 2005, 03:30:30 PM
I like the ability for users to place them pin.  That way it's up to them how accurate they want to be with where they live.  I know for a fact it is possible to dynamically load the info but have no idea how.

But then you'd have people wishing they were in Hawaii or Jamaica and posting pins where they don't really belong. 

Gobalopper

TLM one thing you could do to reduce the javascript size is assign things like this to variables:
                    icon.image = "http://labs.google.com/ridefinder/images/mm_20_blue.png";
                    icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";


They are just strings and repeated all over the place.

The best way to limit the number of pins shown may be to show an "area" of pins. So for example store the co-ordinates of Japan and have a dropdown that users select to just see the pins from that area.

For the world view instead of showing each pin do it by density marked out by grids. That would help load times.

Or just show less data about the user... or if its possible use the same technology Google Maps uses to dynamically load the user details into the bubble.

TLM

#51
Quote from: Gobalopper on September 06, 2005, 10:14:58 PM
TLM one thing you could do to reduce the javascript size is assign things like this to variables:
                    icon.image = "http://labs.google.com/ridefinder/images/mm_20_blue.png";
                    icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";


They are just strings and repeated all over the place.
You know I started down that path but I dunno why I did not finish that up...  I have like it is for gender purposes but could easily change that some and it would be much better..

*edit* Think I got it a bit more simplified but one of my testers says it does not load now in IE so time to chase that down... */edit

Quote from: Gobalopper on September 06, 2005, 10:14:58 PM
The best way to limit the number of pins shown may be to show an "area" of pins. So for example store the co-ordinates of Japan and have a dropdown that users select to just see the pins from that area.

For the world view instead of showing each pin do it by density marked out by grids. That would help load times.

Or just show less data about the user... or if its possible use the same technology Google Maps uses to dynamically load the user details into the bubble.
Well on my site that is certainly possible seeing how for part of the site is using a continent as to help trim a list of xfire names, maybe I could use same thing to help control the pins like your saying.

I was just looking thru the api some more and looked at where the google code apparently can phrase a xml file of lat/long cord.  Only question I have is if it supports data as well.

Ride

Quote from: wowzer on September 06, 2005, 10:01:43 PM
Quote from: Ride on September 06, 2005, 03:30:30 PM
I like the ability for users to place them pin.  That way it's up to them how accurate they want to be with where they live.  I know for a fact it is possible to dynamically load the info but have no idea how.

But then you'd have people wishing they were in Hawaii or Jamaica and posting pins where they don't really belong. 

They could do the same thing with zip code.  I see your point though.

vdubbia

Quote from: Ride on September 06, 2005, 10:58:29 PM
Quote from: wowzer on September 06, 2005, 10:01:43 PM
Quote from: Ride on September 06, 2005, 03:30:30 PM
I like the ability for users to place them pin.  That way it's up to them how accurate they want to be with where they live.  I know for a fact it is possible to dynamically load the info but have no idea how.

But then you'd have people wishing they were in Hawaii or Jamaica and posting pins where they don't really belong. 

They could do the same thing with zip code.  I see your point though.

Actually you're right.  How about the pins resolving by IP?

Ride

Quote from: wowzer on September 06, 2005, 11:40:15 PM
Quote from: Ride on September 06, 2005, 10:58:29 PM
Quote from: wowzer on September 06, 2005, 10:01:43 PM
Quote from: Ride on September 06, 2005, 03:30:30 PM
I like the ability for users to place them pin.  That way it's up to them how accurate they want to be with where they live.  I know for a fact it is possible to dynamically load the info but have no idea how.

But then you'd have people wishing they were in Hawaii or Jamaica and posting pins where they don't really belong. 

They could do the same thing with zip code.  I see your point though.

Actually you're right.  How about the pins resolving by IP?


I think we are getting off track here.  Let's get the core of the code working first.  Resolving by IP is very general and usually not very acurate.

TLM

#55
Well on my test server I am playing with loading the pins via XML now.  The live site I have been giving you guys still has old way.  I am running into same limitations with XML, so many then browser lockup.

So right now I would say its functional for a test on other than my site.  Unfortantly I stink at making a mod package, anyone of us want to do that for me?

(This version wont be release but instead tested by us that have posted in this thread already)

Ride

Quote from: TLM on September 09, 2005, 04:05:43 PM
Well on my test server I am playing with loading the pins via XML now.  The live site I have been giving you guys still has old way.  I am running into same limitations with XML, so many then browser lockup.

So right now I would say its functional for a test on other than my site.  Unfortantly I stink at making a mod package, anyone of us want to do that for me?

(This version wont be release but instead tested by us that have posted in this thread already)

If you want to send me the files that have been modified this is something I can do.  I'd like to test it out too.  I have 3 different testing servers all with different configurations.  You can email me at ride[at]fracturedmedia.com

TLM

May have an idea for kind of a fake stream of data.  Currently looking at the API documentation, it appears I could get the bounds of whats being viewed.  With that, I could use the xml method of data, produced by a php script with a "limitation window".  Where js would query the script with the bounds to query from the db, and hard cap at say 500 pins max viewable.  Of course the pins would probally be a random choosing from the whole.  If it is indeed possible which I think it is, the only thing left would be geocoding for those to layze to go place there pins, and from what it sounds like you guys already have that done.

Sorry Ride, got carryed away in Guild Wars since last post till now, and well....

* TLM wanders back to the code, to see if the idea can be done.

Tony Reid

I have attached my UK SQL data for postcode/long/lat lookups :)

I havent done anything with the USA  side of things  - so dont have zipcode - But I think Ride might have ?

Hope that helps,

Tony
Tony Reid

TLM

#59
Well it certanly looks possible, managed to figure out how the code returns its bounds and I have come up with a small little table or so of how the reloading of data should go.  Want a little input on that from you guys...


ZoomIf zoom changeDescription
17UhhThe entire world multiple times...
16Random Pins up to 250(?)/Base/StartThe entire world
15Use from previous levelThe entire world minus a little bit
14Reload to within bounds, 250(?)A continent at best.
13Use from previous level, unless change greatA bit closer to the continent
12Reload to +10 of bounds, 250(?)A large section of the area
11Use from previous levelA section of the area
10Relaod to +5 of bounds, 250(?)State size
9Use from previous levelSection of state size
8Reload to +2 of bounds, 250(?)Larger than a city
7Use from previous levelA city
6Use from previous levelMajor roads in a city
5Use from previous levelStart to see indivdual streets
4Use from previous levelCan ident indivdual streets
3Use from previous levelCan ident indivdual streets
2Use from previous levelCan ident indivdual streets
1Use from previous levelCan ident indivdual streets
0Use from previous levelCount the cars...

Rough refrencing is provide below, starting at 16...
http://maps.google.com/maps?q=Detroit&spn=167.668829,562.429688&hl=en
Its not a great refrence due if you are using a high resolution.  I really produced table on my site but that code will change before people read it.

Advertisement: