We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13428 ☆ A M B ☆
    • 1,031 Posts
    Just two enhancements:

    For smaller maps it is nicer not to center the Marker in the middle of the map. To get it a little bit more below regarding the scaling factor you have to add/change two lines:

    insert after line 56
    $coord[2] = $lat + (64 / bcpow (2, $zoom));


    change line 113
    map.setCenter(new GLatLng('.$coord[2].','.$coord[0].'),'.$zoom.');


    In Germany it is possible to calculate your route via google map. To get the displayed marker as the endpoint of the route you have to add a link in the bubble like this (line 143)
          $gmapjs .= 'var myMarkerContent = "<div style=\"width:'.$bubblewidth.'px; overflow:auto;\"><h4>'.$title.'</h4><p>'.$address.'</p><p><a href=\"http://maps.google.com/maps?daddr='.$coord[1].','.$coord[0].'('.$title.')\">Route hierher</a></div>";';


      • 9549
      • 93 Posts
      How well can you get this to work with zipcodes besides UK/US? I’m trying to get around this with locations in Sweden.
      I applied the fix by kimosabi on line 51 (http://modxcms.com/forums/index.php/topic,5582.msg110312.html#msg110312), to geocode the adress instead of the zipcode. But the problems is if there’s two diffrent places with the same street name.


      FIXED:

      I got it. Google Maps want to see the string like this "Kungsg. 15, 37230 RONNEBY, Sverige".
        • 24731 ☆ A M B ☆
        • 211 Posts
        I just started playing with this, at my frist attemp it did not work when I called uncache [!!] I had to call cached to get the display [[ ]]. not sure why yet.

        Jose
          • 36571
          • 145 Posts
          There seems to be a problem with using TVs as parameter values e.g. address1:[*address*] causes the snippet call itself to be output in HTML.

          Is there a workaround for this?

          Any help you be appreciated. Thanks.
            • 8960
            • 150 Posts
            This is possible. For example, here’s my call:
            <a name="gMapLink"></a>[!GoogleMap? &key=`{{GoogleMapAPI}}` &maps=`mapid : map | address1 : [*aptAddress*] | city : [*aptCity*] | state : TX | zip : [*aptZip*] | title : [*aptName*] | width : 550  | height : 300 | zoom : 15 | control : large | typecontrol : 1 | type : map `!]

            So, I know it works. Here’s the result: http://www.apartmenthunterhouston.com/3000-Sage.html
              • 29774
              • 386 Posts
              @danielw

              You’ve most likely got a line break somewhere in the snippet call. Lines breaks will break any snippet.
                Snippets: GoogleMap | FileDetails | Related Plugin: SSL
                • 4749
                • 623 Posts
                I can’t figure out why this map marker is mapping the location across the street from me. The way it’s mapped is almost there, but what can I do to make it exact? Here’s my snippet call:

                [!GoogleMap? &key=`{{GMapAPIkey}}` &maps=`mapid : map | address1 : [*location*] | city : [*city*] | state : [*state*] | zip : [*zip*] | title : [*title*] | width : 708  | height : 400 | zoom : 16 | type : map `!]


                When I first used it I thought it worked great, but then I noticed it was mapping the building across from ours. How can I manually place it? Thanks for any help.
                  The MODx has you...
                  Utah Web Design
                  • 29774
                  • 386 Posts
                  @cbaone
                  I’d suspect that it may be because the Google geocoder is only able to make a best guess of the location of a given address. Sometimes it gets it slightly wrong. You could try providing more detail about the address - make sure you have the first and second line of the address, city/town and zip. If that doesn’t work, you can work out the exact latitude and longitude coordinates by flying to the location using Google Earth, then pass these to the snippet.
                    Snippets: GoogleMap | FileDetails | Related Plugin: SSL
                    • 21119
                    • 4 Posts
                    I am having trouble that the marker is not at the correct location.

                    The marker is in the dead centre of the map, but the actual ’target’ location is down and to the right slightly.

                    I have tried to replace the address with the latitude and longtitude as taken from google earth but either I get a blue background (i.e. no map) with a marker in the middle, or the lat and lng values seem to be totally ignored.

                    I am using version 1.3

                    Could anyone advise? Or provide an example call that illustrates how to use lat and lng?

                    Many thanks.

                    Neil
                      • 29774
                      • 386 Posts
                      @neilmodx

                      have you got the latitude and longitude the right way around? You’re probably getting a location in the middle of the sea if you have them reversed.

                      Example call for a single map:
                      [!GoogleMap? &key=`ABQIAAAA...` &maps=`mapid : map | lat : 50.828078 | lng : -0.135988 | address1 : My Street | city : My City | state : My State | zip : ABC123 | title : My Title | width : 400  | height : 400 | zoom : 9 `!]
                      
                        Snippets: GoogleMap | FileDetails | Related Plugin: SSL