꼰대 개발자의 블로그
Home
  • 분류 전체보기 (180)
    • 이야기 (2)
    • Tools (2)
      • vs code (2)
    • Open API (82)
      • Jquery (47)
      • Naver (2)
      • Google (21)
      • Daum (4)
      • kakao (2)
      • 그 외 (6)
    • DataBase (28)
      • MS-SQL (22)
      • My-SQL (6)
    • Progmming (24)
      • ASP (1)
      • PHP (9)
      • .Net (7)
      • JSP (0)
      • HTML (0)
      • JAVA (0)
      • Python (2)
      • Javascript (4)
      • git (1)
    • CSS (1)
    • OS (15)
      • Microsoft (14)
      • Linux (0)
      • mac (1)
    • Cloud Server (3)
    • 추천 정보 (14)
    • 에러노트 (8)
블로그 내 검색

꼰대 개발자의 블로그

꼰대가 흐름을 따라가고 싶어서 기록하는 블로그

  • Open API/Google

    구글맵 마커 + 말풍선 - v3

    2016. 12. 12.

    by. Yo.

    구글맵 V3 + 마커 샘플입니다.


    일반적으로 기본 구글맵에서 가장 많이쓰는것이기도 한데요..


    Test Url : http://www.uhoon.co.kr/test/4338/4338.html



    <!DOCTYPE html>
    <html>
    
    <head>
    	<meta charset="utf-8">
    	<title>Info windows</title>
    	<style>
    		html,
    		body,
    		#map-canvas {
    			height: 400px;
    			width:600px;
    			margin: 0px;
    			padding: 0px
    		}
    	</style>
    	<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
    	<script>
    		function initialize() {
    			var myLatlng = new google.maps.LatLng(37.55544,127.07590);		// 위경도 수정
    			var mapOptions = {
    				zoom: 17,
    				center: myLatlng
    			};
    
    			var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
    
                            // 말풍선 내용 수정
    			var contentString = '<div style="width:100px;height:50px;">군자동 주민센터</div>';		
    
    			var infowindow = new google.maps.InfoWindow({
    				content: contentString,
    				size: new google.maps.Size(200,100)
    			});
    
    			var marker = new google.maps.Marker({
    				position: myLatlng,
    				map: map
    			});
    			google.maps.event.addListener(marker, 'click', function() {
    				infowindow.open(map, marker);
    			});
    		}
    
    		google.maps.event.addDomListener(window, 'load', initialize);
    	</script>
    </head>
    
    <body>
    	<div id="map-canvas"></div>
    </body>
    
    </html>
    

    * Info Window :  https://developers.google.com/maps/documentation/javascript/examples/infowindow-simple?hl=ko* Info Window Options : https://developers.google.com/maps/documentation/javascript/reference?hl=ko#InfoWindowOptions

    저작자표시 (새창열림)

    댓글

    관련글

    • [Google API] 구글맵 v3 infoBox 2016.12.14
    • 구글맵 v3 단순 다중 마커 (배열이용) 2016.12.12
    • 구글맵 v3 맵상에 보여지는 마커만 생성하기 2016.12.12
    • 구글맵 v3 - 마커 + 말풍선 + GPS 연동+ 원그리기 + 동적 마커 생성( Ajax + Json ) 2016.12.12
    맨 위로
전체 글 보기
  • SyntaxHighlighter 웹버전
Tistory 로그인
Tistory 로그아웃
로그아웃 글쓰기 관리

Today

Total

Powered by ⓒ AXZ Corp.

Designed by Nana
블로그 이미지
Yo.

티스토리툴바