2 of 8
2
Geocoding
Posted: 22 January 2007 06:27 PM   [ Ignore ]   [ # 19 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  650
Joined  05-16-2004

Mark,

Have you considered storing the “zoom” of each point at the time that the click is made?

TTFN
Travis

 Signature 

Fight spam better with “Defensio for EE,” a free module


Hop Studios Internet Consulting
http://www.hopstudios.com/

Profile
 
 
Posted: 22 January 2007 06:43 PM   [ Ignore ]   [ # 20 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1194
Joined  01-05-2006

Hum, yes that would make sense to store the zoom.

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 24 January 2007 06:39 PM   [ Ignore ]   [ # 21 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  168
Joined  11-21-2005

THis sounds fabulous.

Any chance of a working demo/site somewhere?

 Signature 

3mille.com
websemantique.com

"Not everything that count can be counted,
And not Everything that can be Counted Count"
- A.Einstein

Profile
 
 
Posted: 08 February 2007 02:43 PM   [ Ignore ]   [ # 22 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  785
Joined  07-18-2006

This has got to be the coolest extension on the planet.  Great job!

Profile
 
 
Posted: 08 February 2007 02:48 PM   [ Ignore ]   [ # 23 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  785
Joined  07-18-2006

Mark how can I have a marker automatically placed on the map (in the center) by default?  Is that easy to hack in?

EDIT: oh and for people who build sites on dev boxes and then deploy, you can get a google map API that works for ‘localhost’ or a specific IP address - figured I’d mention it…

Profile
 
 
Posted: 08 February 2007 03:02 PM   [ Ignore ]   [ # 24 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1194
Joined  01-05-2006

where would the center be?  where the settings default to?  i’m not sure i entirely understand what you’re trying to accomplish.

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 08 February 2007 03:20 PM   [ Ignore ]   [ # 25 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  785
Joined  07-18-2006

Oh yeah I guess it’s not as cut and dry as I was thinking.  What I would like is for there to be a marker automatically placed in the center of the map after a location is set in the text field.  This is going to be used for adding all kinds of events that a company is hosting, as well as a bunch of other ‘member’ events. So the actual location on a map isn’t necessarily known, but the physical address (text) is.  If the marker could be placed automatically it would be best otherwise you’re just guessing where the center is and hoping you have it correct on the map when you click to add the marker.

One other idea which would be really cool: can you use this in a SAEF?

Profile
 
 
Posted: 08 February 2007 03:39 PM   [ Ignore ]   [ # 26 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1194
Joined  01-05-2006

The functionality should be that as you type the map zooms to the location.  Then when you press return the pin is placed in the center of the map.  Is this not happening for you?

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 08 February 2007 04:05 PM   [ Ignore ]   [ # 27 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  785
Joined  07-18-2006

I didn’t realize you could hit return - I usually try to avoid that when I’m not in a textarea because many times it will submit the form.  Thanks Mark!  BTW you’re my hero - sending a donation now.

Profile
 
 
Posted: 08 February 2007 06:12 PM   [ Ignore ]   [ # 28 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1194
Joined  01-05-2006

hum…I wonder if there would be a better way to present this then?  I’ll have to look into a different interface, because you’re not the first person to have this problem.

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 08 February 2007 06:52 PM   [ Ignore ]   [ # 29 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  785
Joined  07-18-2006

What makes sense to me is that when the google map first figures out the location (the map jumps) it places a marker automatically at that point. If you click to create a new marker or move the auto-generated one, it becomes permanent (or if you move on). If you type a new address and haven’t moved the initial marker, it would remove that one and place a new one when it first resolves that new address.  That sounds difficult to me, but I think it makes sense from a UI perspective.

It’s not the same issue, but one cool thing would be if you could use this field and get the geocode location and also retain the text as well.  For instance right now I’ve got 2 location fields in a weblog - one for the textual address, and one for the geocode. The client will end up having to type (cut and paste) in the address twice for each entry. I was thinking you could do this by finding the lat and long at runtime, but that could be problematic if the google can’t resolve the address properly.

Anyway - just a thought. I still vote it the coolest extension in existence :D

Profile
 
 
Posted: 08 February 2007 07:14 PM   [ Ignore ]   [ # 30 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1194
Joined  01-05-2006

Hum.  Yea, I experimented with saving the text but went without it because the google information is sometimes so different than the written out information.  Especially because the text won’t always match up with the pin, in some cases I’ve found it’s easiest to just type a general location (philadelphia, pa) and then place the pin myself.  In that case I wouldn’t want the general text.  So, because sometimes the text is needed and sometimes it’s not I decided to just drop it all together.  It seemed to make the implementation a little easier to understand.  Good idea with the return though.  I’ll try putting a link or button in to add a pin.

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 15 February 2007 08:44 AM   [ Ignore ]   [ # 31 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  785
Joined  07-18-2006

Mark - have you had an issues with the map not showing in the CP?  It shows fine on the publish pages, but it doesn’t show on the edit pages.  I’m using a Mac - it doesn’t show in either Safari or Firefox.

Another interesting side note - Only the map controls will show in my actual website layout (not the map itself), UNLESS I throw a PHP error, in which case the whole map shows properly.  Gotta love cheese:

EDIT:  So if I remove the width and height parameters in the EE tag calling the google map the map will show up on my site (not talking the CP).  Or if I remove my DOCTYPE from my HTML - but that’s obviously not a good option.

EDIT 2: So I pulled the width and height declarations from the extension, and instead put in a class. If I use CSS to style that class then the map shows up fine on the site sized however I like. Strange quirks.

I pulled the DOCTYPE out of the CP html just for kicks but it didn’t fix it not showing in the edit panel.

EDIT 3: I think this might be the issue?  On the edit page there’s an error thrown (that doesn’t happen on the publish page):

Error: invalid flag after regular expression
Source Code:
Notice:  Undefined offset:  1 in ...path to EE ... /extensions/ext.geo.php on line 428

Profile
 
 
Posted: 16 February 2007 09:21 AM   [ Ignore ]   [ # 32 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  785
Joined  07-18-2006

Mark - found a bug that crashes IE6 consistently.  Line 531 of your extension:

$map.= ($first_pass !== true && $this->fetch_param('inline_embed') != 'false') ? '</script>' : '';

Will crash IE6 every time.

All you need to do is add .x to the API version and all is well (no more crashing IE6).  Like so:

$map.= ($first_pass !== true && $this->fetch_param('inline_embed') != 'false') ? '</script>' : '';

Figured you wouldn’t want to crash all your IE6 users :D

Any ideas on the map not showing in the edit window?  Does it show for you?

Thanks Mark - very cool extension!

EDIT: Whoa!  It is cutting out the important part of the line of code I’m pasting in this post.  The code is on line 531 - like I said just add .x to the script so it turns into http://maps.google.com/maps?file=api&v=2.x instead of http://maps.google.com/maps?file=api&v=2 .  The code shown above isn’t the entire line.

Profile
 
 
Posted: 16 February 2007 09:38 AM   [ Ignore ]   [ # 33 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  785
Joined  07-18-2006

Blah - ok so I lied.  It still crashes IE6 consistently (for some reason it didn’t that one time I reloaded after the change).  Any ideas about this?  I’ve searched the Google Maps API Group to no avail. Does anyone have it working in IE6?

EDIT: Adding the .x throws an error pop-up and stops the page loading at that point, but shows the page and map - just not any HTML after that.  Not having the .x throws the error and redirects to an ‘IE cannot load this page’ default page - so technically it isn’t crashing the browser.  The error message that pops says ‘IE cannot open this page. Operation aborted’.

Profile
 
 
Posted: 16 February 2007 09:39 AM   [ Ignore ]   [ # 34 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1194
Joined  01-05-2006

i’m looking at it now, and it doesn’t seem to be crashing IE6, but i’ll keep testing.

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 16 February 2007 09:44 AM   [ Ignore ]   [ # 35 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  785
Joined  07-18-2006
Mark Huot - 16 February 2007 09:39 AM

i’m looking at it now, and it doesn’t seem to be crashing IE6, but i’ll keep testing.

I just found this:

My page works in Firefox but not in IE

IE will produce “Operation Aborted” and “Cannot load page” errors after partially rendering the map if the Javascript is contained inside a <table> or <div> or other incomplete element modifies that element.

The easiest fix is to move all your Javascript to the bottom of your HTML file, just before the </body>. Be sure that all open <tag> elements are closed with a matching </tag> before the script.

See other solutions in the FAQs#Browser Problems.

That’s my exact issue I believe as it’s in the middle of multiple wrapper divs.  Is there a way to separate output to two tags so I can call the JS at the bottom of the page?

Profile
 
 
Posted: 16 February 2007 09:54 AM   [ Ignore ]   [ # 36 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  785
Joined  07-18-2006

Hmmm well that doesn’t seem to be my issue either.  I pulled it completely out of the layout and put the map right before the </body> tag - and it’s still crashing IE6 every time.

Here’s more from Google:

  *  My map works in Firefox but I get “Operation Aborted” errors in IE!

  These errors are produced in IE when the javascript tries to change the page before it has completed rendering. There are 3 common ways to solve this problem:

  1. move all the javascript to the <head> of the document and call a makeMap() function which initializes the Google Map in the onload handler (in the <body> tag, <body onload=“makeMap();”>). The onload handler is executed after the page finishes loading. thread1 thread2
  2. put all the javascript at the end of the <body> (just before the </body> tag) see this message.
  3. a variation of #1, use a setTimeout to delay the processing of the map code until the page has finished rendering. see this message.
  4. (variation of 1) use window.onload. Allows multiple onload handlers, see Doug Henderson’s page at multiple onload handlers. This is the way that was used to fix the operation aborted error on the Get_Lon_Lat page here.

Profile
 
 
   
2 of 8
2
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 66468 Total Logged-in Users: 39
Total Topics: 84864 Total Anonymous Users: 23
Total Replies: 455357 Total Guests: 184
Total Posts: 540221    
Members ( View Memberlist )