. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Module; use Fisharebest\Webtrees\Fact; use Fisharebest\Webtrees\I18N; use function view; /** * Class MapLinkGoogle - show locations in external maps */ class MapLinkGoogle extends AbstractModule implements ModuleMapLinkInterface { use ModuleMapLinkTrait; /** * Name of the map provider. * * @return string */ protected function providerName(): string { return I18N::translate('Googleâ„¢ maps'); } /** * @return string */ protected function icon(): string { return view('icons/google-maps'); } /** * @param Fact $fact * * @return string */ protected function mapUrl(Fact $fact): string { // This URL allows us to add a pin at the location. // Other URLs allow us to set the zoom. // Is there one that does both? return 'http://maps.google.com/maps?q=loc:' . $fact->latitude() . '+' . $fact->longitude(); } }