Moved some files in directories.
This commit is contained in:
parent
e23bb22ea2
commit
50a0369ba1
9 changed files with 0 additions and 0 deletions
20
modules/map.php
Normal file
20
modules/map.php
Normal file
|
@ -0,0 +1,20 @@
|
|||
<link rel="stylesheet" href="openlayers/ol.css" />
|
||||
<script src="openlayers/ol.js"></script>
|
||||
|
||||
<?php
|
||||
function ShowMap($lat,$lon){
|
||||
echo '<div style="display:none;"><div id="marker" style="width:10px;height:10px;border-radius:50%;background-color:#ff0000;opacity:0.6;"></div></div>';
|
||||
echo '<div id="mymap" style="width:300px;height:300px;overflow:hidden;"></div>';
|
||||
echo '<script>';
|
||||
echo 'var pos = new ol.proj.fromLonLat([' . $lon . ', ' . $lat . ']);';
|
||||
echo 'var map = new ol.Map({target:"mymap"});';
|
||||
echo 'var osmSource = new ol.source.OSM();';
|
||||
echo 'var myview = new ol.View({center: pos, zoom: 13});';
|
||||
echo 'map.setView(myview);';
|
||||
echo 'var osmLayer = new ol.layer.Tile({source: osmSource});';
|
||||
echo 'map.addLayer(osmLayer);';
|
||||
echo 'var marker = new ol.Overlay({position: pos, element: document.getElementById("marker")});';
|
||||
echo 'map.addOverlay(marker);';
|
||||
echo '</script>';
|
||||
}
|
||||
?>
|
Reference in a new issue