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

#13796
Chris
Keymaster

Hi,

In your code, I don’t see you assigning a height. Also, have you checked the contents of $adresse_complete_resto_br? It may not be a valid address.

The geocoding function will return an instance if WP_Error if there’s an error, so you can check for that if needed.

Here’s an example that works for me:


<?php
$mymap = new Mappress_Map(array("width" => 646, 'height' => 100));
$address = "30 chestnut street";
$mypoi_1 = new Mappress_Poi(array("address" => $address ));
$mypoi_1->geocode(); // Works for me
$mymap->pois = array($mypoi_1);
echo $mymap->display();
?>