You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 26, 2023. It is now read-only.
//import
Yii::import('ext.egmap.*');
//basic setup
$gMap = new EGMap();
$gMap->setWidth(953);
$gMap->setHeight(552);
$gMap->zoom = 16;
$gMap->setCenter(38.257818,-7.992712);
//setup info windows:
$info_window_a = new EGMapInfoWindow('<div>I am a marker with custom image!</div>');
//setup marker icon
$icon = new EGMapMarkerImage("/images/experiences/iconLocal.png");
$icon->setSize(30, 30);
$icon->setAnchor(16, 16.5);
$icon->setOrigin(0, 0);
//setup markers
$markerA = new EGMapMarker(38.257818, -7.992712, array('title' => 'Marker A - With Custom Image','icon'=>$icon));
$markerA->addHtmlInfoWindow($info_window_a);
$gMap->addMarker($markerA);
$markerB = new EGMapMarker(38.257818, -7.99333, array('title' => 'Marker B - With Custom Image','icon'=>$icon));
$markerB->addHtmlInfoWindow($info_window_a);
$gMap->addMarker($markerB);
//place them together - but I see no use for them at this time.
$markers = array($markerA, $markerB);
//try to map center those markers:
$gMap->centerOnMarkers();
//render
$gMap->renderMap();
Nothing gets centered. Am I missing something, or is this an issue with centerOnMarkers(); ?
Tried:
Nothing gets centered. Am I missing something, or is this an issue with centerOnMarkers(); ?