well
I have had a look at the geocode function and this is what I get when sending the datas directly to google through
http://maps.google.com/maps/api/geocode/json?address=8bis avenue du palais des expositions, 66000 perpignan&sensor=false&output=json®ion=FR&language=FR
returns
{
"status": "OK",
"results": [ {
"types": [ "street_address" ],
"formatted_address": "8 Avenue du Palais des Expositions, 66000 Perpignan, France",
"address_components": [ {
"long_name": "8",
"short_name": "8",
"types": [ "street_number" ]
}, {
"long_name": "Avenue du Palais des Expositions",
"short_name": "Avenue du Palais des Expositions",
"types": [ "route" ]
}, {
"long_name": "Perpignan",
"short_name": "Perpignan",
"types": [ "locality", "political" ]
}, {
"long_name": "Pyrénées-Orientales",
"short_name": "66",
"types": [ "administrative_area_level_2", "political" ]
}, {
"long_name": "Languedoc-Roussillon",
"short_name": "Languedoc-Roussillon",
"types": [ "administrative_area_level_1", "political" ]
}, {
"long_name": "France",
"short_name": "FR",
"types": [ "country", "political" ]
}, {
"long_name": "66000",
"short_name": "66000",
"types": [ "postal_code" ]
} ],
"geometry": {
"location": {
"lat": 42.7047338,
"lng": 2.8932853
},
"location_type": "RANGE_INTERPOLATED",
"viewport": {
"southwest": {
"lat": 42.7015923,
"lng": 2.8901326
},
"northeast": {
"lat": 42.7078876,
"lng": 2.8964279
}
},
"bounds": {
"southwest": {
"lat": 42.7047338,
"lng": 2.8932752
},
"northeast": {
"lat": 42.7047461,
"lng": 2.8932853
}
}
},
"partial_match": true
} ]
}
which seems absolutely perfect.
So it should work with this php code:
$mymap = new Mappress_Map( array( "width" => 600, "height" => 450 ) );
var_dump($address);
$mypoi = new Mappress_Poi( array( "title" => "", "body" => "", "point" => array("address" => $address[0]) ) );
$mypoi->geocode( );
$mymap->pois = array($mypoi);
$mymap->display( );
the var dump returns:
array(1) { [0]=> string(63) "8bis, avenue du palais des expositions, 66000 Perpignan, France" }
but my POI doesn't show up :(
Any other hint ?
Sincerely
Olivier