Last active
December 10, 2015 13:58
-
-
Save mcfdn/4443916 to your computer and use it in GitHub Desktop.
LiteMap documentation example 4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$map = new LiteMap_Container(); | |
$map->setCenter(51.500152, -0.126236); | |
$locations = array( | |
'51.500152' => '-0.126236', | |
'51.512249182894756' => '-0.15815299440919262', | |
'51.52325165255695' => '-0.11283439089356762', | |
'51.47238304492127' => '-0.15883963991700512', | |
'51.49077068938746' => '-0.07232230593263012' | |
); | |
$map->setWidth(700); | |
$map->setHeight(400); | |
foreach($locations as $lat => $lng) { | |
$marker = new LiteMap_Marker($lat, $lng); | |
$marker->setTitle('Latitude: ' . $lat . ', Longitude: ' . $lng); | |
$marker->setDraggable(true); | |
$map->addOverlay($marker); | |
} | |
?> | |
<head> | |
<?php echo $map->getJs(); ?> | |
</head> | |
<body> | |
<?php echo $map->render(); ?> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment