We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5811
    • 1,717 Posts

    I have started a new snippet around Google Maps API V3: Gmaps. It runs for Evo, but I will port it to Revo in a next step.

    Discover some demos: From Las Vegas to Salt Lake City and some volcanoes

    Here are some explanations about this snippet.
      • 18373 ☆ A M B ☆
      • 3,141 Posts
      This is definitely a nice snippet. Looks like it can be very convenient for some mapping site features.
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 25663 MODX Staff
        • 12,272 Posts
        Very cool snippet and looking forward to seeing it in Revo. wink

        I take it you’ve been to all those places? smiley
          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • 36527
          • 120 Posts
          Nice work but a heads up - the info windows on hover do not work in Safari 5.0.3 OS X sad

            • 26931
            • 2,314 Posts
            Hi coroico,

            this looks great!

            how did you manage to get the route displayed on the map? http://www.modx2.wangba.fr/index.php?id=318

            thanks, j
              • 5811
              • 1,717 Posts
              how did you manage to get the route displayed on the map?
              The road is described as a kml file.
              Gmaps has a parameter named kml that accept a csv list of KML or GeoRSS files. e.g: &kml=`usa-1,usa-2,usa-3` All these files are added as overlays on the map.

              To set up the trace, I define the road with google maps. Then, get the link to the map (button on the upper left side of the map). copy/paste this link in your browser with &output=kml then you will get a kml file.
              If the trace is too long Google probably cut your trace. So you probably need save several traces.
              Open the kml file created by google maps and remove all unwanted tags to get a light file like this one:

              <?xml version="1.0" encoding="UTF-8"?>
              <kml xmlns="http://earth.google.com/kml/2.2">
              <Document>
                <name>USA 99</name>
                <description><![CDATA[National Parks - 1999]]></description>
                <Style id="style5">
                  <LineStyle>
                    <color>7f0000ff</color>
                    <width>4</width>
                  </LineStyle>
                </Style>
                <Placemark>
                  <name>From Las Vegas to Salt Lake City</name>
                  <description><![CDATA[]]></description>
                  <styleUrl>#style5</styleUrl>
                  <LineString>
              <coordinates>
              -115.148750,36.085941,0.000000
              -115.148033,36.084648,0.000000
              -115.147461,36.083900,0.000000
              
              ... about 19630 coordinates are stored in the kml file
              
              -111.891037,40.760738,0.000000
              -111.891037,40.760738,0.000000
              </coordinates>
                  </LineString>
                </Placemark>
              </Document>
              </kml>
                • 26931
                • 2,314 Posts
                ah, interesting - nice smiley

                would it be possible, lets say for a Blog-post about a route, to add this kml file via file-TV input? i guess this would be doable by an reasonably tech-savey editor (grabbing the coordinates, fill them in a clean kml-file & upload)
                  • 11858
                  • 130 Posts
                  Looks great Coricio!

                  Looking forward to the Revo version...
                    • 26931
                    • 2,314 Posts
                    coroico,

                    is the Snippet already downloadable? smiley

                    thanks, j
                      • 5811
                      • 1,717 Posts

                      Gmaps 1.0.0 is now available in the repository. You can download it from http://modx.com/extras/package/gmaps

                      A cheatsheet document details installation steps and parameters details. Thanks for your feedbacks.

                      The revo version coming soon.

                      @Jan : Changes / 0.9
                      - The mkrIconTv issue has been fixed.
                      - A infoboxAjaxId parameter has been added to manage the ajax response to fill the content of marker infowindows.