나는 자바 스크립트의 초보자입니다. 맵에 마커를 추가하고 싶습니다. 지금 내가 어떻게 할 수 있니?Google지도에 마커를 추가하는 방법 - javascript
나는이 위치를 설정하려면 : LatLng(35.738943, 51.326078);
내지도 :
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: name
});
이 무엇 전체 코드는 것입니다 : 당신이지도를 만든 후
<script type="text/javascript">
// When the window has finished loading create our google map below
google.maps.event.addDomListener(window, 'load', init);
function init() {
// Basic options for a simple Google Map
// For more options see: https://developers.google.com/maps/documentation/javascript/reference#MapOptions
var mapOptions = {
// How zoomed in you want the map to start at (always required)
zoom: 17,
// The latitude and longitude to center the map (always required)
center: new google.maps.LatLng(35.738943, 51.326078),
// How you would like to style the map.
// This is where you would paste any style found on Snazzy Maps.
styles: [ { featureType:"all", elementType:"all", stylers:[ { invert_lightness:true }, { saturation:10 }, { lightness:30 }, { gamma:0.5 }, { hue:"#1C705B" } ] } ]
};
// Get the HTML DOM element that will contain your map
// We are using a div with id="map" seen below in the <body>
var mapElement = document.getElementById('map');
// Create the Google Map using out element and options defined above
var map = new google.maps.Map(mapElement, mapOptions);
}
</script>
<script src="js/wow.min.js"></script>
<script>
wow = new WOW(
{
} )
.init();
</script>
https://developers.google.com/maps/documentation/javascript/examples/marker-simple – geocodezip