-
-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Map] Introduce
ux_map.google_maps.default_map_id
configuration
- Loading branch information
Showing
9 changed files
with
87 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,12 +17,20 @@ | |
use Symfony\UX\Map\Renderer\Dsn; | ||
use Symfony\UX\Map\Renderer\RendererFactoryInterface; | ||
use Symfony\UX\Map\Renderer\RendererInterface; | ||
use Symfony\UX\StimulusBundle\Helper\StimulusHelper; | ||
|
||
/** | ||
* @author Hugo Alliaume <[email protected]> | ||
*/ | ||
final class GoogleRendererFactory extends AbstractRendererFactory implements RendererFactoryInterface | ||
{ | ||
public function __construct( | ||
StimulusHelper $stimulus, | ||
private ?string $defaultMapId = null, | ||
) { | ||
parent::__construct($stimulus); | ||
} | ||
|
||
public function create(Dsn $dsn): RendererInterface | ||
{ | ||
if (!$this->supports($dsn)) { | ||
|
@@ -42,6 +50,7 @@ public function create(Dsn $dsn): RendererInterface | |
url: $dsn->getOption('url'), | ||
version: $dsn->getOption('version', 'weekly'), | ||
libraries: ['maps', 'marker', ...$dsn->getOption('libraries', [])], | ||
defaultMapId: $this->defaultMapId, | ||
); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters