yii2mod / yii2-google-maps-markers
Google Maps Markers displays a set of user addresses as markers on the map.
Installs: 12 619
Dependents: 2
Suggesters: 0
Security: 0
Stars: 18
Watchers: 6
Forks: 17
Open Issues: 2
Type:yii2-extension
Requires
- yiisoft/yii2: *
Requires (Dev)
This package is not auto-updated.
Last update: 2024-09-20 21:49:33 UTC
README
Google Maps Markers Widget for Yii2
GoogleMaps Widget displays a set of user addresses as markers on the map.
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require yii2mod/yii2-google-maps-markers "*"
or add
"yii2mod/yii2-google-maps-markers": "*"
to the require section of your composer.json.
Usage
To use GoogleMaps, you need to configure its [[userLocations]] property. For example:
echo yii2mod\google\maps\markers\GoogleMaps::widget([ 'userLocations' => [ [ 'location' => [ 'address' => 'Kharkiv', 'country' => 'Ukraine', ], 'htmlContent' => '<h1>Kharkiv</h1>', ], [ 'location' => [ 'city' => 'New York', 'country' => 'United States', ], 'htmlContent' => '<h1>New York</h1>', ], ], ]);
Configuration
To configure the Google Maps key or other options like language, version, library, or map options:
echo yii2mod\google\maps\markers\GoogleMaps::widget([ 'userLocations' => [...], 'googleMapsUrlOptions' => [ 'key' => 'this_is_my_key', 'language' => 'id', 'version' => '3.1.18', ], 'googleMapsOptions' => [ 'mapTypeId' => 'roadmap', 'tilt' => 45, 'zoom' => 5, ], ]);
OR via yii params configuration. For example:
'params' => [ 'googleMapsUrlOptions' => [ 'key' => 'this_is_my_key', 'language' => 'id', 'version' => '3.1.18', ], 'googleMapsOptions' => [ 'mapTypeId' => 'roadmap', 'tilt' => 45, 'zoom' => 10, ], ],
To get key, please visit page
Google Maps Options
You can find them on the options page