We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Geocoding

Development and Programming

Mark Bowen's avatar
Mark Bowen
12,637 posts
15 years ago
Mark Bowen's avatar Mark Bowen

Hi Mark,

Yes the map works quite well in the CP. I did notice that I was running a slightly older version of the extension that actually worked slightly better in the CP, just a few small issues though on operation but nothing too bad. When I submit the entry it shows the lat and long co-ordinates but then that is about it. If I go to the single-entry template that I have set up for the entry then it just shows up the code and not the actual map.

Thanks.

Mark

       
Mark Huot's avatar
Mark Huot
587 posts
15 years ago
Mark Huot's avatar Mark Huot

can you try outputting the raw coordinates? does that parse?

{office_location_raw}
{latitude}, {longitude}
{/office_location_raw}
       
Mark Bowen's avatar
Mark Bowen
12,637 posts
15 years ago
Mark Bowen's avatar Mark Bowen

Hi Mark,

Have tried that too before and it literally outputs what you have written to the page. You can see it in action (or perhaps not) here at this page.

http://www.markbowendesign.com/index.php/site/comments/photo_test_2

Any more ideas would be greatly appreciated as I would really like to get this all working. I’ve never had a problem with any of your extensions before so I’m not too sure what I must be doing wrong here.

Thanks.

Mark

       
Mark Huot's avatar
Mark Huot
587 posts
15 years ago
Mark Huot's avatar Mark Huot

is there any way you could get me a login to your CP, Mark? I’d be happy to check it out for you.

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
15 years ago
Mark Bowen's avatar Mark Bowen

Hi Mark,

PM now on its way!

Oh one other thing that I did notice is that when I first create an entry the Google map shows up fine but on subsequent edits the map isn’t there!

Strange.

Thanks for the help.

Mark

       
Mark Huot's avatar
Mark Huot
587 posts
15 years ago
Mark Huot's avatar Mark Huot

Alright, there was some screwyness going on in the PHP that I’ve taken care of in version 1.0.5. Grab it up top.

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
15 years ago
Mark Bowen's avatar Mark Bowen

Hi Mark,

Thanks for the update but unfortunately it still isn’t working. The map now works when I go to re-edit an entry but it still doesn’t work in the entry page.

Is there anything else I should be doing?

Thanks.

Mark

P.S. Just a quick question as I wanted to make sure that I have actually even read correctly as to what this extension does. I should be able to place a pin(s)? onto the map in the CP and then show the map on the entry page?

       
allgood2's avatar
allgood2
427 posts
15 years ago
allgood2's avatar allgood2

I just installed version 1.0.5 and it works, at least in the control panel. I haven’t tested elsewhere yet. But on the Admin Tab, when I select custom fields, then the field group that contains custom geo coordinates field, I get the following error

Notice: Undefined variable: field_type in /www/pmh4349/public_html/waubesa/cp/cp.publish_ad.php on line 7311

It just screw with that page of the control panel, and of course only happened once I switch the field type to geo corrdinates; but I couldn’t find any other mentions of the error under the latest version of geocoding. I do have a number of your other extensions running–in fact almost all of your various field types.

       
rick.prince's avatar
rick.prince
111 posts
15 years ago
rick.prince's avatar rick.prince

Thanks Mark for your extension. I was just about to give up on hacking away at my own solution when I came across yours - a sigh of relief.

I love how it remembers the zoom level, but what about map type?

       
Mark Huot's avatar
Mark Huot
587 posts
15 years ago
Mark Huot's avatar Mark Huot

rick.prince - map type wasn’t really possible when I started the extension. It’s something that can probably be integrated later on.

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
15 years ago
Mark Bowen's avatar Mark Bowen

Hi Mark,

Sorry to be a pest but was just wondering if you had ever had any luck with my problem? Still can’t get the map to show up on the site but it does show in the control panel every now and then.

Thanks.

Mark

       
Adam George's avatar
Adam George
283 posts
15 years ago
Adam George's avatar Adam George

I have masked access to the control panel using a sub-domain.

Thus, I need two api keys: - one for admin.mysite.com (inside the CP) - another for mysite.com (the public site)

It would be great if there could be an option for two API keys, one for within the masked CP and another for the live site.

I tried doing this myself, but it’s beyond me.

       
Adam George's avatar
Adam George
283 posts
15 years ago
Adam George's avatar Adam George

For anyone else who comes across this problem, here’s how I fixed it:

About line 284 of ext.geo.php, I replaced this:

fetch_setting('google_key') ?>" type="text/javascript">

With this:

[removed]('<\/script>');

So it will disregard the key you put in the CP, and it will be hardcode, but it’s soles this particular problem. (Would still be better to have the extension use multiple keys though).

       
Adam George's avatar
Adam George
283 posts
15 years ago
Adam George's avatar Adam George

For anyone else who comes across this problem, here’s how I fixed it:

About line 284 of ext.geo.php, I replaced this:

<script src="http://maps.google.com/maps?file=api&v=2.58&key=<?php echo $this->fetch_setting('google_key') ?>" type="text/javascript"></script>

With this:

<script type="text/javascript"> document[dot]write(
    '<script src="http://maps.google.com/maps?file=api&v=2.58&key=' +
    {
        'mysite.com': 'google_api_key_1',
        'subdomain1.mysite.com': 'google_api_key_2',
        'subdomain2.mysite.com': 'google_api_key_3'
    }[location.host] +
    '" type="text/javascript"><\/script>' );
</script>

Replace the [dot] above, with an actual dot/period(.)

So it will disregard the key you put in the CP, and it will be hardcoded, but it’s solves this particular problem. (Would still be better to have the extension use multiple keys though).

       
vibe9's avatar
vibe9
96 posts
15 years ago
vibe9's avatar vibe9

@Mark Bowen - I found some good documentation for integrating and customizing my maps here:

http://www.google.com/apis/maps/documentation/#The_Hello_World_of_Google_Maps

And if this helps, in the HEAD of my page I’ve combined EE code with Google’s JS like this:

map.setCenter(new GLatLng({exp:weblog:entries limit="1" dynamic="on" rdf="off"}{office_location_raw}{latitude}, {longitude}{/office_location_raw}{/exp:weblog:entries}), 13);
       
First 4 5 6 7 8 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.