Created
December 19, 2018 06:03
-
-
Save je8n/a5e3f330241cdb76bfef72c575bae3a0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<html> | |
<head> | |
<script src="https://api-maps.yandex.ru/2.1/?lang=tr_TR" type="text/javascript"></script> | |
</head> | |
<body> | |
<div id="map" style="width: 100%; height: 850px; border:0px; margin:-9px;"></div> | |
<script type="text/javascript"> | |
ymaps.ready(function () { | |
var myMap = new ymaps.Map('map', {center: [38.873928, 35.397949],zoom: 7}), | |
MyIconContentLayout = ymaps.templateLayoutFactory.createClass('<div style="color: #FFFFFF; font-weight: bold;">$[properties.iconContent]</div>'); | |
<?php | |
foreach($noktalar as $nokta){ | |
echo 'noktaekle(myMap,"'.$nokta["baslik"].'","'.$nokta["yazi"].'","'.$nokta["tip"].'","'.$nokta["lat"].'","'.$nokta["lng"].'");'; | |
} | |
?> | |
}); | |
function noktaekle(myMap,title,clicktext,png,lat,lng){ | |
myPlacemark = new ymaps.Placemark([lat,lng], {hintContent: title,balloonContent: clicktext}, { | |
iconLayout: 'default#image', | |
iconImageHref: 'harita_png/'+png+'.png', | |
iconImageSize: [32, 40], | |
iconImageOffset: [-15, -30] | |
}); | |
myMap.geoObjects.add(myPlacemark); | |
}; | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment