We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29774
    • 386 Posts
    You probably have a javascript error somewhere in your template.
      Snippets: GoogleMap | FileDetails | Related Plugin: SSL
      • 17771
      • 14 Posts
      Thanks for your reply. I checked the template for javascript exception, but there are none.

      This is the code section I am using in my chunk for displaying the google map

      [!GoogleMap? &key=`ABQI...` &maps=`mapid : map | address1 : Unit 3 Cygnet Park | address2 : Phorpress Way | city : Peterborough | state : Cambs | zip : PE7 8FQ | title : Tile Library | width : 400 | height : 400 | zoom : 9 | type : hybrid `!]

      ->I have removed the key for security reasons

      Do you see other possible areas that might be a problem ?

      Another problem that I have is the address parameters are fetched from the another page through POST parameters. Hence the googlemap snippet cannot be called from the chunk, but from another snippet. I’d appreciate it if you can let me know how to do this too.

      Thank in advance

      Vinzy
        Vinzy
        • 17771
        • 14 Posts
        Hi,
        I went through this forum and found that by remove functions from the onload function in body the google maps is getting displayed.
        But i still need to know how to call the googlemaps snippet from another snippet. Your help will be really appreciated.

        This is the section of snippet that I am using

        $street = $_POST["street"];
        $city = $_POST["city"];
        $zip = $_POST["zip"];
        $key = "`ABQIAAAA..bQ`";

        $concatenated = "`mapid : map1 | address1 : ". $street ." | city : ". $city. " | zip : ".$zip." | width : 400 | height : 400 | zoom : 9 | type : hybrid`";
        $param = array (
        "key" => $key,
        "maps" => $concatenated
        );
        $modx->runSnippet("GoogleMap",$param);

        When I run this code, it tells me that google rejected the key and does not display the map. Let me know how to proceed.

        Thanks
        Vinzy
          Vinzy
          • 10487 MODX Staff
          • 1,535 Posts
          Quote from: [email protected] at Jul 10, 2009, 04:42 PM

          $key = "`ABQIAAAA..bQ`";
          Try removing those backticks in your key ... that’s my first guess smiley
            Garry Nutting
            Senior Developer
            MODX, LLC

            Email: [email protected]
            Twitter: @garryn
            Web: modx.com
            • 17771
            • 14 Posts
            I tried removing the backticks; the key was not rejected. But the map does not show up...ny bright ideas??
              Vinzy
              • 10487 MODX Staff
              • 1,535 Posts
              I think the problem is that you need to do something with the output from $modx->runSnippet(), try returning the output from that method in your wrapper snippet:
              return $modx->runSnippet("GoogleMap",$param);
                Garry Nutting
                Senior Developer
                MODX, LLC

                Email: [email protected]
                Twitter: @garryn
                Web: modx.com
                • 17771
                • 14 Posts
                Hi,

                I tried including the return statement, but still I dont get the google map to display. I am open to other suggestions on how you would get the address information from POST parameters and then use them to display the map.

                Vinzy
                  Vinzy
                  • 17771
                  • 14 Posts
                  Hi,

                  I included some sample echo statements in the include file and found that both the parameters $key and $maps have their values respectively.
                  But the map does not show up. This was the error information I get when I checked it IE-7. Some kind of javascript problem which I could not figure out. Kindly help me with this issue.

                  Webpage error details

                  Message: Object required
                  Line: 299
                  Char: 26
                  Code: 0
                  URI: http://maps.gstatic.com/intl/en_us/mapfiles/159e/maps2.api/main.js

                  --
                  Vinzy
                    Vinzy
                    • 17771
                    • 14 Posts
                    Hi,

                    I have solved the issue. I removed the sidekicks from the parameters also and then used the return statement and all the onload functions in the body that prefetched images and it now works perfectly fine. Thanks everybody for your help.

                    Cheers,
                    Vinzy
                      Vinzy
                      • 12013
                      • 61 Posts
                      Thought I would try on this thread first, I have used this snippet and it appears almost to be working as I want but not quite. I have searched the forum to find out if anyone else has had the problem but to no avail.

                      I am getting a couple of odd characters before the google map which do not seem to do anything apart from just look ugly, any ideas?

                      http://www.completeapartments.com/st-anns-quays.html

                      also the snippet does not appear to work in IE6 which may be due to these characters?? All that displays is the html of the <div id="map" style="width" etc

                      any help is much appreciated