Changed the id of the map div.
This commit is contained in:
parent
c843dc824e
commit
74607145f2
1 changed files with 2 additions and 2 deletions
4
map.php
4
map.php
|
@ -4,10 +4,10 @@
|
||||||
<?php
|
<?php
|
||||||
function ShowMap($lat,$lon){
|
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 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="map" style="width:300px;height:300px;overflow:hidden;"></div>';
|
echo '<div id="mymap" style="width:300px;height:300px;overflow:hidden;"></div>';
|
||||||
echo '<script>';
|
echo '<script>';
|
||||||
echo 'var pos = new ol.proj.fromLonLat([' . $lon . ', ' . $lat . ']);';
|
echo 'var pos = new ol.proj.fromLonLat([' . $lon . ', ' . $lat . ']);';
|
||||||
echo 'var map = new ol.Map({target:"map"});';
|
echo 'var map = new ol.Map({target:"mymap"});';
|
||||||
echo 'var osmSource = new ol.source.OSM();';
|
echo 'var osmSource = new ol.source.OSM();';
|
||||||
echo 'var myview = new ol.View({center: pos, zoom: 12});';
|
echo 'var myview = new ol.View({center: pos, zoom: 12});';
|
||||||
echo 'map.setView(myview);';
|
echo 'map.setView(myview);';
|
||||||
|
|
Reference in a new issue