Reply To: Map generated from custom fields / display in template don't show

Home Forums MapPress Support Map generated from custom fields / display in template don't show Reply To: Map generated from custom fields / display in template don't show

#13794
fanchrobin
Participant

( sorry, I missed that on the above post) the url is : http://semiocode.com/tsbv2/nos-maisons/manoir-de-la-boulaie/)
Just made some tests, and get closer to the solution.
You were right, latitude and longitude were missing.
I tried with a POI containing the point parameter and it works. But the problem still remains to output latitude and longitude from the geocode() function. I need to dynamically generate latitude and longitude from address.

This code works:

$mymap = new Mappress_Map(array("width" => 646));
$mypoi_1 = new Mappress_Poi(array("address" => $adresse_complete_resto_br, "point" => array("lat" => 47.1913630, "lng" => -1.4291270) )); // the address parameter is not necessary
$mymap->pois = array($mypoi_1); 
echo $mymap->display();

This code doesn’t work:

$mymap = new Mappress_Map(array("width" => 646));
$mypoi_1 = new Mappress_Poi(array("address" => $adresse_complete_resto_br ));
$mypoi_1->geocode(); // Apparently not working
$mymap->pois = array($mypoi_1); 
echo $mymap->display();