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

    is there an easy way to implement a "noscript fallback"? I think about images that are generated by Google Static Maps API.

    I got 5 waypoints to my home and the original GoogleMapMarker-snippet works without problem.

    Of course i must offer a different page in noscript-Tag, but i don’t know how to include the 5 images with their descriptions on one page (i don’t want to do that manually , because what are servers for ?;)) Maybe an completely new snippet would be easier (but i’m no programmer ...).

    Thanks in advance.


    Sorry, ditto is the solution.

    Ditto-Call:
    [[Ditto?parents=`135`&tpl=`GoogleStaticMap`&showPublishedOnly=`0`&summarize=`all`&sortBy=`createdon`&sortDir=`ASC`]]


    Ditto-Template (API-Key is stored in chunk "GoogleAPI"):
    <h2>[+title:slashandstrip+]</h2>
    <table>
    <tr>
    <td><img src="http://maps.google.com/staticmap?center=[+description+]&markers=[+description+],red&zoom=16&size=500x300&key={{GoogleAPI}}" alt="[+title:slashandstrip+]" style="margin-right: 10px;"/></td>
    <td>[+content:slashandstrip+]</td>
    </tr>
    </table>
      Bye,
      Mithrandir
      • 24265
      • 3 Posts
      Hi Doze, great snippet and almost got it working... almost. I have MODx 0.9.5, Ditto 1.0.2 (which I do not use actively) and GoogleMapMarker 1.0c.

      GoogleMapCode chunk:
      var point = new GLatLng([+description+]);
      var marker = createMarker(point, '[+title+]', '[+summary+]');
      map.addOverlay(marker);


      Document called maps (109) which has code:
      [[GoogleMapMarker? &apiKey=`ABQIAA...` &centerPos=`51.9700,5.9321` &defaultZoom=`14`  &mapType=`satellite` &startId=`110` ]] 


      Published Map is called GoogleMaps (110) with unpublished document Marker001 (111) in it. Page 111 has:
      Title: Marker001-test
      Description: 51.9500,5.8505
      HTML: Here I live

      Map appears correct, centers as it should, but I can’t add a marker. Just don’t know where to find the answer... Any idea? Thanks in advance!
        • 7923
        • 4,213 Posts
        Have you created the phx:slashandstrip snippet as instructed? link to the site would help.


          "He can have a lollipop any time he wants to. That's what it means to be a programmer."
          • 24265
          • 3 Posts
          I have made the "phx:slashandstrip" snippet. Still no marker Does it matter that I use ditto 1.0.2 instead of ditto 2..? I read this in the instruction:

           * Example GoogleMapMarker template chunk (&tpl)
           * ---------------------------------------------
           * The template must have 2 divs. A div for the map and div for the side links. That's it.
           *
           *  <div id="map" style="float:left; width: 350px; height: 350px;">Loading map...</div>
           *  <div id="maplinks" style="margin-left: 10px; padding-right: 10px; float: left; display: block; height: 350px; overflow: auto;"></div>
           */


          Don’t know what to do with that. Where do I put this?

          Site is: http://www.aircover.nl/index.php?id=109
            • 25663 MODX Staff
            • 12,272 Posts
            I don’t think 1.0.2 supported PHx, but not sure. It’s relatively old!
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
              • 7923
              • 4,213 Posts
              It seems that Ditto is not outputting anything to the html source of your page.. In the snippet that I have done in page 6 of this thread, I have put following info:

              Version: 1.0c for ditto v2+

              So you might want to try a newer version of Ditto..


                "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                • 33030
                • 24 Posts
                Hello,

                My configuration : MODX 0.9.6.1, DITTO 2.0.2

                I created the snippet you give on page 6, i created the chunk phx:slashandstrip and i call the snippet like this :
                [!GoogleMapMarker? &apiKey=`ABQIAAAAFBujl6xYhny1x37IACM7_RT3Ldxy9-0HHVh9huwU0mmD6GDqURRyna6RoQy6ds_-cZLOn3hX39EAug` &startID=`6` &centerPos=`47.357955,6.354132` &defaultZoom=`10`!]


                I have 2 problems :
                - the map is ok on firefox but i don’t have the markers (childs of folder which id is 6 with coords in description and text in content field)
                - on IE, i have a javascript syntax error on line 208 (map.addControl(new GLargeMapControl());)

                Where is the problem? Any idea?
                Thanks a lot for your answer.

                  • 7923
                  • 4,213 Posts
                  Is the site online? Could you give a link?


                    "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                    • 33030
                    • 24 Posts
                    I’ve found my problem.
                    The document with my marker must be unpublished.
                    Now, it’s ok!

                    Thanks.
                      • 8960
                      • 150 Posts
                      Ok. I finally have something up to show, but I need help. I’m running the page 6 code, Ditto 2.0.2, MODx 0961p2, the PHx slashandstrip... I think that’s it.

                      I’ve a Folder/Container (id=2; http://ahh.campfiresites.net/listings.html) which shows all my documents within. Each document is published and contains their own map since I’m displaying listings of available apartments. The maps show up just fine for each apartment/document and I even got the Google geocoder to pull the address correctly and feed it back into GoogleMapMarker.

                      Issue #1: Markers don’t show up on any page.

                      Issue #2: IE craps out on the JavaScript on any page with a map (all the listings pages): http://ahh.campfiresites.net/3000-Sage.html

                      I’m not sure I’m using GoogleMapMarker as I’m supposed to (just showing the unpublished docs with a container), but rather I’m using it the way I need to. I really would like to have the full functionality of GMM working, but I’m not sure what else I need to do.

                      My call is this
                      [!GoogleMapMarker? &apiKey=`{{GoogleMapAPI}}` &startID=`[*id*]` &centerPos=`[*MapGeoCode*]` &tpl=`gMapTPL` &defaultZoom=`15` !]

                      I’m using the default template povided with GMM, the API is called within a Chunk, and the TV MapGeoCode is pulling the address, running some code and provding the coordinates GMM needs.

                      Again, everything is working great in Firefox (sans the markers), but nothing works in IE.

                      Thanks for looking!

                      Eric