2010-11-19 6 views
0

3 일간의 시험 후에 나는 그것을 포기할 것입니다. Google Maps API를 사용하여 여러 점으로 구성된 긴 선이있는지도를 만들려고합니다. 불행히도 XML 파일을 업로드하지 않아도 나를 위해 효과가있었습니다 (Google 계정으로 성공적으로 승인되었지만).C# : 줄이있는 Google지도 만들기?

지도를 작성하고 선을 그리는 방법에 대한 도움을 받고 C#/VB 코드 (스 니펫)를 게시 할 수 있습니까? 도와 주셔서 감사합니다!

베르트

당신이 구글 맵 자바 스크립트 API를 사용하는 경우, 여기에 샘플입니다

답변

0

:

<!DOCTYPE html> 
<html> 
<head> 
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> 
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/> 
<title>Google Maps JavaScript API v3 Example: Polyline Simple</title> 
<link href="http://code.google.com/apis/maps/documentation/javascript/examples/default.css" rel="stylesheet" type="text/css" /> 
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> 
<script type="text/javascript"> 

    function initialize() { 
    var myLatLng = new google.maps.LatLng(0, -180); 
    var myOptions = { 
     zoom: 3, 
     center: myLatLng, 
     mapTypeId: google.maps.MapTypeId.TERRAIN 
    }; 

    var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); 

    var flightPlanCoordinates = [ 
     new google.maps.LatLng(37.772323, -122.214897), 
     new google.maps.LatLng(21.291982, -157.821856), 
     new google.maps.LatLng(-18.142599, 178.431), 
     new google.maps.LatLng(-27.46758, 153.027892) 
    ]; 
    var flightPath = new google.maps.Polyline({ 
     path: flightPlanCoordinates, 
     strokeColor: "#FF0000", 
     strokeOpacity: 1.0, 
     strokeWeight: 2 
    }); 

    flightPath.setMap(map); 
    } 
</script> 
</head> 
<body onload="initialize()"> 
    <div id="map_canvas"></div> 
</body> 
</html> 
+0

죄송합니다, 나는 C# 코드에서지도를 구축 할 필요가 있음을 명확히 할 필요가 아닌 웹 사이트 . 그래도 고마워! – Norbert

+0

그럼지도를 어디에서 보여주고 있습니까? winform? – Kangkan

+0

예,지도가 응용 프로그램에 표시됩니다. – Norbert

관련 문제