Welcome Guest, Not a member yet? Register   Sign In
Biostall Google Maps lib not working with non-latin letters
#1

[eluser]Dani[/eluser]
Hi. Library seems to work fine, except when I put a non-latin letter in the position:

$marker["position"]="Ålesund"; //wont work
$marker["position"]="Göteborg"; //wont work
$marker["position"]="Oslo"; //works fine


At the top of my view I have:
<code>
<!DOCTYPE HTML>
&lt;html lang="en"&gt;
&lt;head&gt;
&lt;meta charset="utf-8"&gt;
</code>
#2

[eluser]Dani[/eluser]
Here is some code

Code:
function geolocation($address)
{
echo "address=".$address;
$sensor="false";
$address=urlencode($address);
$geoCodeURL="http://maps.googleapis.com/maps/api/geocode/json?address=$address&sensor;=$sensor";
echo "<br>geoCodeURL=$geoCodeURL<br>";
$result = json_decode(file_get_contents($geoCodeURL), true);
echo "<hr>";print_r($result);
}

//output:
address=Nordre Torg 2 , 3513 Hønefoss , Norway

geoCodeURL=http://maps.googleapis.com/maps/api/geocode/json?address=Nordre+Torg+2,+3513+Hønefoss,+Norway&sensor=false

Array ( [results] => Array ( ) [status] => ZERO_RESULTS )


If I type the URL in the browser address field, it works fine and status = OK.
#3

[eluser]BIOSTALL[/eluser]
Hi Dani,

Thanks for using my library. I'll look at adding this as a fix to the library over the forthcoming weeks and will update this thread once it's been done.

Thanks again,
Steve
#4

[eluser]Dani[/eluser]
Thanks in advance!




Theme © iAndrew 2016 - Forum software by © MyBB