Search

I have a geographic search function on this page which plots nearby locations on a Google Map.

I am trying to plot the search origin location on the map too and have a remote datasource looking up the geocode as follows:

http://maps.google.com/maps/api/geocode/xml?address=london+{$url-origin}&sensor=false

The problem is that the lookup fails if there is a space in the search query string such as "SW17 7RH".

Is there a way to replace spaces in a URL parameter in order to show "SW17+7RH" in the remote DS URL instead of "SW17 7RH"?

Thanks in advance for any help on this :-)

http://maps.google.com/maps/api/geocode/xml?address=london+{translate($url-origin,' ','+')}&sensor=false

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details