Skip to content
This repository was archived by the owner on Jul 26, 2023. It is now read-only.
This repository was archived by the owner on Jul 26, 2023. It is now read-only.

Can't get markers centered #11

@talofo

Description

@talofo

Tried:

//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(); ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions