We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3689
    • 264 Posts
    I’m using Google Maps and the part of the example they used is
    http://maps.google.com/maps/api/staticmap?center=Brooklyn+Bridge,New+York,NY


    I’m going to change that to

    http://maps.google.com/maps/api/staticmap?center=[*address*],[*city*],[*state*]


    With this it would grab the variables from the page, but is there a way to change "1234 home address" to "1234+home+address" so it displays the map correctly?
      • 4172
      • 5,888 Posts
      you can try:
      http://maps.google.com/maps/api/staticmap?center=[!replaceSpace? &toreplace=`[*address*],[*city*],[*state*]`&with=`+`!]

      snippet replaceSpace:
      <php?
      return str_replace(' ',$with,$toreplace);


      or create phx-modifier which does the same.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 3689
        • 264 Posts
        Quote from: Bruno17 at Jan 22, 2010, 12:22 AM

        you can try:
        http://maps.google.com/maps/api/staticmap?center=[!replaceSpace? &toreplace=`[*address*],[*city*],[*state*]`&with=`+`!]

        snippet replaceSpace:
        <php?
        return str_replace(' ',$with,$toreplace);


        or create phx-modifier which does the same.

        thx alot! the image works!