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

    I was wondering if you could help me? I'm new-ish to Modx Revolution but I have to say that I love it. I'm trying to learn everyday. At the moment, I have a client who is looking for a geology website that marks certain historic locations on a map with information. So when you'd go on the site, you'd see a map with a lot of markers and when you click on one of the markers, the info box would open up with the option of linking to an information page on the product. I've done some research and I came across work for Modx Revo Gmaps but I'm struggling to get it going as there isn't much information on it.

    A lot of the links are broken to a certain website so I can't find much information on it. I have the PDF for Gmaps 1.0.5 for Revo but I'm still struggling. I've downloaded the Gmaps in the Extras. I added the [[!Gmaps]] parameter to the template and it shows a world map centred on France. I then added template variables mkrLatLong, mkrImage, mkrContent and the chunk for the icons and the code below and it centred over Gabon in Africa.

    I've created a home page that holds the map and then child pages that sit behind the home page parent folder. How do I link these like getResources?

    This is the code I have so far: From reading other forums.

    [[!Gmaps?
    &mapWidth='100%'
    &mapHeight='400px'
    &mapLatLng='[[*mkrLatLong]]'
    &markers='[[*id]]'
    &mkrClick='link'
    &mkrOver='info'
    &infoboxAjaxId='1'
    ]]

    [[!GmapsInfobox?
    &mkrIconTv='mkrImage'
    &mkrTextTv='mkrContent'
    ]]

    I don't know how to add the AjaxInfoBox. I'm struggling with that. Do you have any videos as guides or anymore help sheets. I'm doing this on my localhost first using a wamp server before I'd look to put it live on a URL.

    Can anyone help me please?

    This question has been answered by lkfranklin. See the first response.

      • 17301
      • 932 Posts
      Hi Colln1981,

      I haven't actually used the extra myself but on the face of it it looks to me like you need to use an additional extra called getids and set your &markers=`` to the parent ID of the resources you want to include.

      https://github.com/jiripavlicek/gmaps/blob/master/modCategory/6e25da195b1962b069ff1502291c44c4/0/gmaps/docs/Gmaps100_v1.5.pdf



        ■ email: [email protected] | ■ website: https://alienbuild.uk

        The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
        • 51265
        • 32 Posts
        Quote from: lkfranklin at Mar 20, 2017, 01:59 PM
        Hi Colln1981,

        I haven't actually used the extra myself but on the face of it it looks to me like you need to use an additional extra called getids and set your &markers=`` to the parent ID of the resources you want to include.

        https://github.com/jiripavlicek/gmaps/blob/master/modCategory/6e25da195b1962b069ff1502291c44c4/0/gmaps/docs/Gmaps100_v1.5.pdf




        Thanks a million LK for the reply. I'm just going to have to do more research. I've installed the extra getids but no joy. I'll keep trying
          • 17301
          • 932 Posts
          Did you set the parameters in the &marker to the parent and to also include children?

          Try:
          &markers=`[[getIds? &ids=`[[*id]], c[[*id]]`]]`
            ■ email: [email protected] | ■ website: https://alienbuild.uk

            The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
            • 51265
            • 32 Posts
            Quote from: lkfranklin at Mar 21, 2017, 04:15 PM
            Did you set the parameters in the &marker to the parent and to also include children?

            Try:
            &markers=`[[getIds? &ids=`[[*id]], c[[*id]]`]]`

            I'm getting there. I changed the code to;

            [[!Gmaps?
            &mapWidth='100%'
            &mapHeight='400px'
            &markers='[[GetIds? &ids='[[1,c1]]']]'
            &mkrClick='link'
            ]]

            And the pin is now showing but it's only showing one pin. My home page is set to 1 and inside that are two pages 2 and 3. It is showing the pin for page 2 but not page 3.

            I'm a step further than I was yesterday smiley
            • discuss.answer
              • 17301
              • 932 Posts
              Whey smiley great news.

              Can you confrim that both 2 and 3 are published and not hidden from menus? Does it work if you set the call to both &markers=`2` and for `3` seperately?

              I don't see any documentation for a limiter but its worth also trying

              &limit=`0`

                ■ email: [email protected] | ■ website: https://alienbuild.uk

                The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
                • 51265
                • 32 Posts
                Quote from: lkfranklin at Mar 21, 2017, 07:30 PM
                Whey smiley great news.

                Can you confrim that both 2 and 3 are published and not hidden from menus? Does it work if you set the call to both &markers=`2` and for `3` seperately?

                I don't see any documentation for a limiter but its worth also trying

                &limit=`0`


                I've got the pins working. Thanks a million for your help. I changed the markers code to what you mentioned above and it works. This is my code now

                [[!Gmaps?
                &mapWidth=`100%`
                &mapHeight=`400px`
                &zoom=`8`
                &markers=`[[!GetIds? &ids=`c[[*id]]`]]`
                &mkrClick=`link`
                &mkrOver=`info`
                ]]

                Next step is the pop up window for the pin. Thanks again