We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14431
    • 65 Posts
    Very Cool! I just got my first map up in MODx.
    A recommendation...
    In the source file it says:
    * 3. Add the &startID parameter to the snippet call pointing to the folder what has the marker documents
    * example: [[GoogleMapMarker? &apikey=`ABQIA..` &startID=`52`]][/QUOTE]

    where it says "&apikey" it shoud say apiKey.

    Also to center the map where you want, use something like:
    [[GoogleMapMarker? &apikey=`ABQIA..` &startID=`52` &centerPos = 38, -120]]
    No quotes or anything around the lat, lon values.

    Didn’t take long to figure it out, but would have been immediate success with these little tidbits.

    Thanks for the great work!!!
    joe
      • 7923
      • 4,213 Posts
      Quote from: JoeP at Oct 15, 2006, 02:52 PM

      What i was thinking of was not that it would display the coordinates, but it would return the coordinates as well as the click event.

      ....

      Perhaps the map routine could even be equiped with a listener registration so that one could tie arbitrary routine(s) to the map click event.
      That would be more on the google map api + javascript side than in the snippet side to add specific handlers. Look here for a list of available events that the api offers..

      To have click handler for example, you would need to add something like this:

      GEvent.addListener(map, ’click’, function(overlay, point){
      alert("long = " + point.x + ", lat = " + point.y);
      }

      etc..

      Quote from: JoeP at Oct 15, 2006, 03:32 PM

      Very Cool! I just got my first map up in MODx.
      A recommendation...

      Thanks, I’ll fix those..


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 14431
        • 65 Posts
        fyi
        I happened to stumble across this post in the google maps api group. It discusses a problem with google maps in a MODx site that had problems in IE (not IE7). It also gives a solution.
        http://groups.google.com/group/Google-Maps-API/browse_frm/thread/1e43b088c9d10adb/e57637772553106b?lnk=gst&q=modx&rnum=1#e57637772553106b
        joe
          • 17688
          • 6 Posts
          I have a problem with GoogleMapMarker… I’ve made all steps listed in the instructions (minus ditto, but not necessary ?). The map appear but not the marker. I have a folder (id=38) with two markers inside with the coords in the desc. field.

          To pass this bug, I’ve hardcoded the snippet with (for debugging):

          //
          var point = new GLatLng(49.228024,6.006603);
          var marker = createMarker(point, "CDPI", "CDPI

          <img width=118 height=74 src=http://www.netguru.fi/modx/assets/images/logo.png alt= />");
          map.addOverlay(marker);

          and the marker is naturally here, but not the link in the linksDiv.

          Any Idea ?

          http://www.immocdpi.com/
            • 7923
            • 4,213 Posts
            Quote from: luntereiner at Nov 02, 2006, 02:42 PM

            I’ve made all steps listed in the instructions (minus ditto, but not necessary ?).
            Are you saying that you don’t have Ditto installed? It is necessary for GoogleMapMarker to work.


              "He can have a lollipop any time he wants to. That's what it means to be a programmer."
              • 17688
              • 6 Posts
              Oops! I didn’t see that in the instructions… or it’s my poor english, so let’s go… again!

              thx Doze.
                • 7923
                • 4,213 Posts
                Oh, sorry about that, I was sure I had written that to the instructions.. It’s there now.

                EDIT: found it, I had only put the note in the snippet code header..


                  "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                  • 14431
                  • 65 Posts
                  Quote from: doze at Nov 02, 2006, 03:59 PM

                  Quote from: luntereiner at Nov 02, 2006, 02:42 PM

                  I’ve made all steps listed in the instructions (minus ditto, but not necessary ?).
                  Are you saying that you don’t have Ditto installed? It is necessary for GoogleMapMarker to work.

                  When you say ditto has to be installed do you mean that it has to be installed in MODx so that it shows up in the available snippet list or is something more required?
                  I’m not sure what I did, but I managed to make the markers not show up at all sad
                  ditto was installed with MODx (0.95) when MODx was installed.
                  I made sure and unpublished the marker files and parent.
                  everything is set to non-cachable.
                  I tried making the marker description with and without RTE.
                  It appears that the marker does not show up in the rendered html at all.

                  Any ideas?
                  Thanks,
                  joe
                    • 7923
                    • 4,213 Posts
                    The ditto parameter names may have changed and causes the snippet to not be run correctly.

                    At line 318 you see:
                    $modx->runSnippet($dittoName,array('descendentDepth' => $descendentDepth, 'sortBy' => $sortBy, 'sortDir' => $sortDir, 'summarize' => 'all', 'displayArchive' => '0', 'tpl' => $dittoChunk, 'startID' => $startID, 'showPublishedOnly' => '0', 'trunc' => '0'));
                    


                    Make sure by comparing to your Ditto snippet parameters that the names are the same.. I think that descendentDepth has atleast changed to just depth.. Maybe changing that helps. But if it doesn’t check the other parameter names too and report back please!



                      "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                      • 14431
                      • 65 Posts
                      Quote from: doze at Nov 13, 2006, 11:01 AM

                      The ditto parameter names may have changed and causes the snippet to not be run correctly.

                      At line 318 you see:
                      $modx->runSnippet($dittoName,array('descendentDepth' => $descendentDepth, 'sortBy' => $sortBy, 'sortDir' => $sortDir, 'summarize' => 'all', 'displayArchive' => '0', 'tpl' => $dittoChunk, 'startID' => $startID, 'showPublishedOnly' => '0', 'trunc' => '0'));
                      


                      Make sure by comparing to your Ditto snippet parameters that the names are the same.. I think that descendentDepth has atleast changed to just depth.. Maybe changing that helps. But if it doesn’t check the other parameter names too and report back please!


                      According to the ditto 1.02 documentation at http://modxcms.com/ditto_parameters.html
                      the parameters descendentDepth, sortBy sortDir, showPublishedOnly, and trunc are valid.

                      code for each appears to be present in the ditto 1.02 snippet code... such as:
                      $descendentDepth = (isset($descendentDepth))? $descendentDepth : 10;
                      // number of levels deep to go


                      I found the problem(s)... Apparently in my attempts to make fancy marker lables I had both used an RTE which intrduced a second line, and I had published the marker page. Once I got ride of the editor, removed all but one line, and un-published the page, it seems to be working agin.

                      Feature Request: Support for multi-line HTML in the content so that more complicated html markers do not have to be written, or re-formatted, onto a single line.

                      Thanks very much for both the snippet and quic responses to support requests!
                      joe