I am using the FieldtypeMapMarker module to display a location on a map. The address comes from a different database (see my other topic Parameterized template).
I tried this:
function getMap($object) {
$map_module = wire('modules')->get('MarkupGoogleMap');
$page = wire('page');
$page->map->address = "{$object['strasse']} {$object['hausnummer']}, {$object['plz']} {$object['ort']}";
var_dump($page->map);
$rendered_map = $map_module->render($page, 'map');
return "<div class='sf_map'>$rendered_map</div>";
}
that means, I just set the map address from $object with the members street, house number, zip and city. Such an address string is for example: "Rathausgasse 75, 3011 Bern".
This does not work, however. var_dump() shows the address I want, but the map ignores it. It uses instead the default address I saved in the field.