Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID Sign In with Twitter
Support for Vanilla Forums Cloud product

In this Discussion

Follow Us


Member Google Map

2

Comments

  • One more quick thing! The current version of the add-on doesn't display the select location map in Safari on Windows. It's a quick fix, just edit the css for the GoogleMap class as follows:

    #GoogleMap {
    margin-top:4px;
    margin-bottom:4px;
    text-align:center;
    border:1px solid #666;
    padding-top:5px;
    padding-bottom:5px;
    width:400px;
    height:300px;
    }
  • Uploaded version 1.2.1 of Member Google Map.
  • @amosborne - Good catch, the new version adds your Safari fix.
  • i just downloaded this but when i go to Manage Map Location no map pops up; i must put in the longitude and latitude in order to set my location. i thought a map was supposed to load?
  • same here as smw, there is no map loading
  • Uploaded version 1.2.2 of Member Google Map.
  • Hi, I didn't want to make my users figure out their lat/long so I added a quick hack for address lookup, maybe it'll be useful to someone else. Thanks for the nice add-on.

    @line 202:

    <script type="text/javascript">
    //<![CDATA[

    var geocoder = null;
    geocoder = new GClientGeocoder();

    function showAddress(address) {
    if (geocoder) {
    geocoder.getLatLng(address,
    function(point) {
    if (!point) {
    alert("Sorry, " + address + " not found");
    } else {
    document.getElementById("txtlatitude").value = point.lat();
    document.getElementById("txtlongitude").value = point.lng();
    }
    }
    );
    }
    }
    //]]>
    </script>


    @line 210

    <form action="#" onsubmit="showAddress(this.address.value); return false">
    <ul><li>Lookup your Address <input type="text" name="address" maxlength="255" class="SmallInput" />
    <input type="submit" value="Get Coordinates">
    </form></ul>


    and moved this form down from line 202 below the above form.

    <form id="frmAccountMyBlogs" method="post" action="'.GetUrl($this->Context->Configuration, 'account.php','', '', '', '', '').'">
    <input type="hidden" name="PostBackAction" value="ProcessManageLocation" />
    <input type="hidden" name="u" value="'.$u.'" />
  • jpack, your little address lookup sounds perfect. Any chance you could post a link to your full code though? I haven't been able to implement your code changes successfully, the line numbers don't seem to be matching up for me. Thanks!
  • Hmm, it's possible other changes I've made shifted the line numbers around. Here's a diff against the clean downloaded of the MemberGoogleMap-2007-08-25 version. You should be able to just run patch with this.
    If that doesn't work whisper me your email and I'll just email you my live version of the file.


    *** MemberGoogleMap/MemberGoogleMap/default.php Tue Sep 18 09:16:34 2007
    --- default.php Fri Sep 7 14:50:55 2007
    ***************
    *** 199,212 ****
    echo '</div>';
    }
    echo '
    ! <form id="frmAccountMyBlogs" method="post" action="'.GetUrl($this->Context->Configuration, 'account.php','', '', '', '', '').'">
    <legend>'.$this->Context->GetDefinition("ManageMapLocation").'</legend>
    <fieldset>
    - <input type="hidden" name="PostBackAction" value="ProcessManageLocation" />
    - <input type="hidden" name="u" value="'.$u.'" />
    <h2>'.$this->Context->GetDefinition("ManageMapTitle").'</h2>
    <p class="Description">Please use the decimal format.</p>
    <div id="GoogleMap">&nbsp;</div>
    <p>If you don\'t want to display your location insert a zero in both fields</p>
    <ul>
    <li>
    --- 200,241 ----
    echo '</div>';
    }
    echo '
    ! <script type="text/javascript">
    ! //<![CDATA[
    !
    ! var geocoder = null;
    ! geocoder = new GClientGeocoder();
    !
    ! function showAddress(address) {
    ! if (geocoder) {
    ! geocoder.getLatLng(address,
    ! function(point) {
    ! if (!point) {
    ! alert("Sorry, " + address + " not found");
    ! } else {
    ! document.getElementById("txtlatitude").value = point.lat();
    ! document.getElementById("txtlongitude").value = point.lng();
    ! }
    ! }
    ! );
    ! }
    ! }
    ! //]]>
    ! </script>
    !
    <legend>'.$this->Context->GetDefinition("ManageMapLocation").'</legend>
    <fieldset>
    <h2>'.$this->Context->GetDefinition("ManageMapTitle").'</h2>
    <p class="Description">Please use the decimal format.</p>
    <div id="GoogleMap">&nbsp;</div>
    +
    + <form action="#" onsubmit="showAddress(this.address.value); return false">
    + <ul><li>Lookup your Address <input type="text" name="address" maxlength="255" class="SmallInput" />
    + <input type="submit" value="Get Coordinates">
    + </form></ul>
    + <form id="frmAccountMyBlogs" method="post" action="'.GetUrl($this->Context->Configuration, 'account.php','', '', '', '', '').'">
    + <input type="hidden" name="PostBackAction" value="ProcessManageLocation" />
    + <input type="hidden" name="u" value="'.$u.'" />
    <p>If you don\'t want to display your location insert a zero in both fields</p>
    <ul>
    <li>
  • hey jpack, could you email me your code? thank. libin918(at)gmail(dot)com
  • Hi.
    First I like to thank you all for the nice software, and for a very nice and polite community!

    The graphic "Define your coordinates" map does'nt show up?
    I hav'nt bee able to find any solution, and have'nt got a clue how this works?... Any sugestions?

    @jpack. Could i please try your solution?
    emai: orresas at gmail

    Thank's a lot! :)
  • Still cant get more than a blank window above "Define your coordinates".
    Any sugestions please?
  • a shame, this whole thing including the additional code works great except for the "Define your coordinate" clickable part, and i cannot find the reason ... does it work anywhere else? can i see it online somewhere for comparison?
  • GOT IT ... a view to the javascript console made it. disable //console.log(\'geocode\'); in MemberGoogleMap/default.php and maybe //lat = point.lat(); //lng = point.lng()
  • Beautiful Keith!

    Disabled the "console.log ..." line and it works like a charm! :-)
    Thank's a lot mate!!

    and *** HAPPY NEW YEAR!!! ***
  • I want this so bad, but when I install it, it makes my account page completely disappear. This is a brand-new install of Vanilla and this happens with no other addons running.

    This is a forum for a local community, so it would be very, very useful. Any ideas?
  • I could never get this to work. Then I got it to work when we changed servers. Now, I've enabled eAccelerator and I'm getting the original error messages. Account pages won't load; manage.location error or similar. Do you have eAccelerator enabled?
  • Hadn't worked half a year ago.
    Doesn't work today.

    After installation on a brand new Vanilla and entering the mapkey,
    theres only an empty maps-frame.
  • Just to let anyone know (who's interested). We had two problems with this extension over at the Kohana forums and managed to fixed them.

    Symptoms:

    • The map doesn't appear (when you have already saved a location and you are trying to change it).
    • Clicking on the map doesn't set your longitude or latitude.
    Solution:

    • Remove the following line from default.php (line 267):
      console.log('geocode');
    • Change lines 259 and 260 of default.php from:
      $('txtlatitude').value = point.lat();
      $('txtlongitude').value= point.lng();

      to:
      document.getElementById( 'txtlatitude' ).value = point.lat();
      document.getElementById( 'txtlongitude' ).value = point.lng();
  • In my system, I had to change this: document.getElementById( 'txtlatitude' ).value = point.lat(); document.getElementById( 'txtlongitude' ).value = point.lng(); to this (just double-quotes): document.getElementById( "txtlatitude" ).value = point.lat(); document.getElementById( "txtlongitude" ).value = point.lng(); and it worked perfectly thanks for the pointer!
  • I tried the solution of removing the console.log line and changing the lat and lng lines to the document.getElementyById and I still get JavaScript errors when I try to click on the Map.
  • can you post some more info about the js errors?
  • I cant get it to save the locations of my members..... Where are the locations of the members actually stored? On the forum or with google.
  • the locations are stored in the forum users database as a two column value (for lat & long)
  • OK here is our forum: http://gatheringofthevibes.com/2008/Vanilla-1.1.4 You must register @ www.gatheringofthevibes.com so I installed the Google maps extension as is and I had the bug with the map not showing.... so I went in and deleted the console.log line.... now the map shows but when the users select there location then go back to View All Members none are shown... I tried this fix: document.getElementById( 'txtlatitude' ).value = point.lat(); document.getElementById( 'txtlongitude' ).value = point.lng(); and this one chashes the who board, we just get a white screen..... so I did this one: document.getElementById( "txtlatitude" ).value = point.lat(); document.getElementById( "txtlongitude" ).value = point.lng(); and no crash but it doesnt save any of my users locations.... can anyone help?
  • I've got 2 problems (Vanilla 1.1.4 and MemberGoogleMap 2007-09-04):

    1. Problem with incorrect script URL into head area:

    <script type="text/javascript" src="/forum/http://maps.google.com/maps?file=api&amp;v=1&amp;key=QIAARHpD7WXGNjwe0G2M_guncTIu5c9xRe2s5M4E9DZ7KxbxCooVnGOaVRXQ"></script></head>;

    2. Problem with database - longitude and latitude didn't exist in User table.

    Solution

    ad.1. Change line 39
    $Head->AddScript('http://maps.google.com/maps?file=api&amp;v=1&amp;key='.$Context->Configuration['GOOGLEMAP_KEY']);

    to

    $Head->AddScript('http://maps.google.com/maps?file=api&amp;v=1&amp;key='.$Context->Configuration['GOOGLEMAP_KEY'], '');

    ad.2. Add columns manually.
  • Hi- I get this when I click

    Notice: Undefined variable: Context in /home/xxxxxx/public_html/vf/extensions/MemberGoogleMap/default.php on line 60

    Notice: Trying to get property of non-object in /home/xxxxxx/public_html/vf/extensions/MemberGoogleMap/default.php on line 60


    Can anyone tell me how to handle this?

    Thankyou!
  • Insert global $Context; in line 60
  • busterkat: to fix that problem, add this just before line 60:

    global $Context;

    -- Jason
2
Sign In or Register to comment.