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
    Thanks Martijn for the links. Very interesting. Ace Hardware is nearly AdvSearch + Gmaps wink
      • 5811
      • 1,717 Posts
      Gmaps 1.0.0 is now available for Revo. You get it from the repository.

      Take care, the url for download indicated in the cheatsheet is incorrect (I will update the package later).

      http://modx.com/extras/package/gmaps2 => Revo

      http://modx.com/extras/package/gmaps => Evo

      Demo site under revo 2.0.8 available here

      Tested with: Firefox 4.0, IE 8, Safari 5.0.5, Google Chrome 10.0.648


      As I have fixed an issue with IE, I will deliver a new minor release (1.0.1) for Evo.
        • 5811
        • 1,717 Posts
        Release 1.0.1 for Evo is now available in the repository: http://modx.com/extras/package/gmaps

        Changelog:

        Issues fixed:
        - IE issue when several markers are displayed on a map
        - Wrong control of latLng initial value

        Improvements:
        - Control of the latLng value marker. If the latLng is not correct the marker is not displayed
        - Several maps could be displayed on the same page. Use a different mapId for each map.

        Gmaps 1.0.1 for Evo and Gmaps 1.0.0 for Revo have the same features and the same parameters

        Tested with: Firefox 4.0, IE 8, Safari 5.0.5, Google Chrome 10.0.648
          • 18463
          • 121 Posts
          Martijn van Turnhout Reply #24, 15 years, 5 months ago
          Excellent extras, thank you! Add-ons like these are really useful.
            • 21635
            • 81 Posts
            thanks so much for the Revo-Version, just testing it out at the moment.

            I will dive into your code now, searching for a possibility to dynamically (without page refresh) add or remove markers...
            if there is already a (yet hidden) way, please feel free to tell me wink


            also, i can’t make promises concerning that store-finder. i probably won’t code an extra, because i don’t have the skills to do so. i rather want to use existing tools to get to my targets...
              • 21635
              • 81 Posts
              okay, after some hours of fiddling, i will just write what i tried and wait for some kind of response smiley

              so basically what i tried to do, is to have the gmaps-snippet call in an external resource and load it dynamically via jquery ajax-call.

              i did so, because i wanted to transmit the ids as a get-variable to the AJAX-resource. that would look a little like this.
                var uri = "[[~941? &ids=`936` &scheme=`full`]]";
                
              $(".retailer #refresh_map").click(function(e){
                  e.preventDefault();
                  $(".retailer #maps_placeholder").empty().load(uri, function(){
                    initialize();
                });
              });


              but, as you can imagine, this code is not working, as your snippet constructs the javascript it needs for initializing in the header tag of the page, alongside with the linking of google-js files.
              so i can draw in the html of the remote-resource, but when i call initialize(), it initalizes the map with the values of the "local" resource.

              i also tried ways to draw in the JS from the remote-resources’ header, but failed and things got messy, so i thought i’ll let it rest for a bit.

              --

              in the end, i envision the use-case, that i can call the remote-URL and pass a long the IDs via GET and receive an updated map.

              Do you think this is possible with the current implementation already?
              Or would you need to tweak it hard, to accomplish that use case?

              Some thoughts of yours are much appreciated, thanks!
              niklas
                • 5811
                • 1,717 Posts

                You can’t pass through ajax a complete result of Gmaps for updating a Map.

                If you would like display a new map from a location result, i think you need to:

                - create an empty map without markers => At the begining, you can hide the map by hiding the <div> section.

                - modify Gmaps to add a js function addMarker(map,markerid):
                * With the markerid through an ajax call you get the marker info (latLng, imgMarker ...)
                * you erase the content of the current map
                * add the new marker
                * display the map again
                * show the <div> section to show the new map

                - add this addMarker function as clickEvent handler to a link "show location" near each search result.

                  • 21635
                  • 81 Posts
                  thanks i will try to go for that and post if it worked...
                    • 7253
                    • 97 Posts
                    Thanks for Gmaps btw - it’s pretty great!

                    I’m just trying to upgrade it. I can see the upgrade from Gmaps 1.0.0 pl in my package manager, but when I click ’Yes’ to upgrade to gmaps101_331.zip, I get the following message:

                    +------------------------+
                    |  Error              [x]|
                    --------------------------
                    |  provider_err_connect  |
                    --------------------------
                    |      [   OK   ]        |
                    +------------------------+
                    


                    This doesn’t happen with other packages, which I can install and upgrade fine. Has anyone else seen this issue with Gmaps?

                    Thanks,
                    Dunc
                      • 28107
                      • 230 Posts
                      German localisation apended:

                        CONIN Werbeagentur . Köln
                        http://www.conin.de