yii2mod/yii2-google-maps-markers Google Maps Markers displays a set of user addresses as markers on the map.

extensiongooglemapsmarkersgooglemaps

993323

Google Maps Markers Widget for Yii2


GoogleMaps Widget displays a set of user addresses as markers on the map.

Latest Stable Version Total Downloads License Build Status

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

Example


Alt text

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

  • 1.426 August 2017
  • 1.301 January 2017
  • 1.222 November 2016
  • 1.117 November 2016
  • 1.005 August 2015

Comments



1.4 is the latest of 5 releases



MIT license
Stats
18 github stars & 17 github forks
4 downloads in the last day
61 downloads in the last 30 days
11458 total downloads