yii2-google-maps-markers icon indicating copy to clipboard operation
yii2-google-maps-markers copied to clipboard

Multiple Maps on same page not working

Open Shesharaopuli opened this issue 7 years ago • 1 comments

I tried multiple maps on same page under tabs design. One is working fine but not the other.


<?=
                GoogleMaps::widget([
                    'containerId' => 'provider_top10_map_container',
                    'id' => 'provider_top10_map',
                    'userLocations' => [
                        [
                            'location' => [
                                'address' => 'Kharkiv',
                                'country' => 'Ukraine',
                            ],
                            'htmlContent' => '<h1>Kharkiv</h1>',
                        ],
                        [
                            'location' => [
                                'city' => 'New York',
                                'country' => 'United States',
                            ],
                            'htmlContent' => '<h1>New York</h1>',
                        ],
                    ],
                    'googleMapsUrlOptions' => [
                        'key' => 'AIzaSyAaUANIimzoTReBvZxpkvToN3o7grnxNWg',
                        'language' => 'en',
                        'version' => '3.1.18',
                    ],
                    'googleMapsOptions' => [
                        'mapTypeId' => 'hybrid',
                    //'tilt' => 45,
                    //'zoom' => '2',
                    ],
                    'wrapperHeight' => '350px'
                ]);
                ?>

<?=
                GoogleMaps::widget([
                    'containerId'=>'provider_all_map_container',
                    'id'=>'provider_all_map',
                    'userLocations' => [
                        [
                            'location' => [
                                'address' => 'Kharkiv',
                                'country' => 'Ukraine',
                            ],
                            'htmlContent' => '<h1>Kharkiv</h1>',
                        ],
                        [
                            'location' => [
                                'city' => 'New York',
                                'country' => 'United States',
                            ],
                            'htmlContent' => '<h1>New York</h1>',
                        ],
                    ],
                    'googleMapsUrlOptions' => [
                        'key' => 'AIzaSyAaUANIimzoTReBvZxpkvToN3o7grnxNWg',
                        'language' => 'en',
                        'version' => '3.1.18',
                    ],
                    'googleMapsOptions' => [
                        'mapTypeId' => 'hybrid',
                    //'tilt' => 45,
                    //'zoom' => '2',
                    ],
                    'wrapperHeight' => '350px'
                ]);
                ?>

Seeing the source I found that only code for the single container only initiating not for the second one.

Please look on to this issue. Registered for image

image image

Shesharaopuli avatar Dec 07 '17 14:12 Shesharaopuli

Hi, thanks, I will check it.

ihorchepurnyi avatar Dec 07 '17 14:12 ihorchepurnyi