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

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

Previous topic - Next topic

Ride

It sounds like you are stuck where I am.  I also have a table with zip, lon and lat data.  We would combine our 2 lists so that both us and uk are covered if this ever gets released as a mod.  I've also got city data so that when they enter the zip code, it will display in their profile what city goes with the zip code.

Tony Reid

Yeah - Sure would be great to merge the two.

I haven't got city data - but the UK doesnt have that many ;D so not too bothered :)

The link above might help with this :)




Tony Reid

Ride

Where you able to make any progress tony?  I didn't get a chance to work on it today.   :-\

Tony Reid

No.... I  started - but im in UK (GMT timezone) so had to go to bed :)

Perhaps if I get a chance  I'll have a go today - and see if we can get the maps plotted :)

I have some thoughts though.

1) Should it work like the 'Location' mod? - is it viable in terms of query length to scan through all members and then build the googlemap?

2) Would it be better to have a link in the members profile that plotted where they are on a google map and calculated the distance between both members? Im not sure how to calculate distance based on long/lat - do you know?

3) Would both of the above be an option?

4)  Does the google key need to be a page in the admin center? I think it does.

I dont have time to do all of this - and think that rather than develop two versions - perhaps we would be better off working on the same mod - thats if your ok with that?

Let me know your thoughts :)

Tony







Tony Reid

Ride

I have had zero time to work on this in the last week.  :(   Anyone else interested in lending their brain power?

kadhumia_flo

GOOGLE MAPS SUX CAMPARED TO GOOGLE EARTH
DONT USE GOOGLE EARTH.. ITS ONLY FOR ME TO ENJOY :P
;D ;D ;D

Ride

Quote from: kadhumia_flo on September 02, 2005, 10:15:55 AM
GOOGLE MAPS SUX CAMPARED TO GOOGLE EARTH
DONT USE GOOGLE EARTH.. ITS ONLY FOR ME TO ENJOY :P
;D ;D ;D

[sarcasm]Thanks for contributing to our discussion[/sarcasm]


Tony Reid

Quote from: Ride on September 02, 2005, 01:40:47 AM
I have had zero time to work on this in the last week.  :(   Anyone else interested in lending their brain power?

I havent had any time at all.

I see someone else has also started a mod - however I do have concerns over how intensive it would be to search the entire members table each time the maps displayed :(

I'm beggining to think that this needs to be rewritten aother way.

Hmmm
Tony Reid

Ride

Quote from: Tony on September 04, 2005, 04:20:51 PM
Quote from: Ride on September 02, 2005, 01:40:47 AM
I have had zero time to work on this in the last week.  :(   Anyone else interested in lending their brain power?

I havent had any time at all.

I see someone else has also started a mod - however I do have concerns over how intensive it would be to search the entire members table each time the maps displayed :(

I'm beggining to think that this needs to be rewritten aother way.

Hmmm

I think a cron or some other way where it is written every day would be the best route.  The cron could write a static xml file for the map to read from.

Tony Reid

Sounds like a good idea :)

Might run into problems with the file ownership - if apache/php  is creating it though.

Might look into it later today :)

Tony,
Tony Reid

TLM

#31
Ah, there is an idea I did not think about, making a static xml file, but currently dont see any performance issues with generating a map off the member data table. 

But looking at what you guys have posted, your using zip codes for some reason, what for?
Im blind, but why not just do like the old member map mod did in YaBB SE, where the user places a pin on the map and you end up just storing the lat and long cordnates that come from the google API code.  Thats what I have so far on my version of this.  Also by doing that that allows the user to be as precise as they want, down to the last street or as far off as just pointing the town.

Tony Reid

Hi,

I need postcodes(zip  codes) so members can calculate distance between each other etc...  my members would not want the fuss of working out long/lat at all.

Placing a pin would not be accurate enough.

Would your map suffer with a lookup of around 10,000 users? do you know how long it would take to draw?

Tony Reid

Tony Reid

#33
If a pin is that acurrate then perhaps it might be an alternative?

Hmm... am off to bed now - but will post again tomorrow :)


*edit - Thinking about this - zip code would be needed if you wanted to search for members in your area?

Perhaps doing a lookup for just your postcode and surroundiong post codes would be smarter than drawing the whole memberbase on a map?
Tony Reid

TLM

#34
Well so far my map does not have to many pins but seems to be ok.  Although I do see a problem in time for the page to be sent coming soon once there are enough pins.  So right now I am looking into storing the data in some method, more than likly an xml file.  The API has a method of importing a XML file and doing things that way but I have not put much time into it due to a person on my forum mentioned using google earth as well.  Which I have put some time into as well.  Whats interesting is the google maps point lat/long data is the same used by google earth so that can be interchangable.

http://www.teamplayfirst.com/forums/index.php?action=membermap
http://www.teamplayfirst.com/forums/index.php?action=.kml - Use google earth as a network link

Also I remember reading somewhere the next revision of the API will have geocoding built in to it if I am not mistaken.

So far my version of this mod has an enable/disable check box, the API key, and gender coloring on the pins, got bubbles/popup with some info, not all I want in there right now.

Unfortantly I started wrong and crossed my lat and long in data storage so I am fixing it now.

A recent little bug I also noted with my idea of placing a pin how the user chooses works but if you zoom out far enough the map repeats and you place a pin on the repeat it causes the pin to be logged but not shown for some reason.  Yet it seems to use the correct lat/long for the placement.

Dannii

Google maps only stores american "zip codes" So it wouldn't be all that nice to non americans would it? Pins are the way to go.
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

Slack

Quotehttp://www.teamplayfirst.com/forums/index.php?action=membermap

TLM, this looks great - is your version available for download? -- or will it be available?

Tnx,
slack

TLM

A few details have to be ironed out first, followed a stress test, and for me to learn how to package it before the public will get a copy of mine.  Right now thats only 54 pins and I know some forums might have somewhere near a few hundred at least so I need to test that as well.

Tony Reid

This is looking great - you have done well :)

I'm looking forward to playing with it on a large scale :)

Tony
Tony Reid

TLM

#39
I just tested it with 10k users, all of which were randomly generated numbers... and well the test results are not as good as I hoped...

action=membermap in the browser downloads a 7.1 meg file on the default theme, 90% (guessing) is the google java script.  Which just causes the browser to hard lock nicely.  So definatly gonna need to look into a better way to show 10k pins.

The file for google earth is about 3.9 meg, (test server differs from my live site) which is an odd decrease but after all it is just xml so not sure.


-rw-r--r--   1 root   root   3.9M Sep  6 10:26 googleEarth.php
-rw-r--r--   1 root   root   7.1M Sep  6 10:18 index.php?action=membermap


But if you want a good laugh, check out the attachment.  I just picked lat 0-90 and long 0-90 as the random feild and well, thats it it seems.

Back to cutting off about 1k pins at a time to find the sweet spot of number of users...

Advertisement: