Posts

Showing posts with the label C#

Google地圖標註與自訂圖示標註

Image
(前言 待補) 自訂標示圖案 改二個地方: 1.Map.html <script>    var m1 = new google.maps.LatLng(24.1564125, 120.6779761); //台中市北區英才路102巷61號    var m2 = new google.maps.LatLng(24.1564069, 120.676978); //台中市北區大雅路100號    var marker;    var map;    var image = 'taxi-icon.png';//image變數指向計程車圖示檔案,圖示檔案請放在相同目錄      function mark(lat, log){//標註座標函式,由C#端呼叫,傳進經度與緯度…        var m = new google.maps.LatLng(lat, log);        marker = new google.maps.Marker({          map:map, draggable:true,          position: m,          icon: image //指定標示圖案為image        }); 2.在目錄中放入圖案檔(用GOOGLE找可用的圖片檔) 參考資料: https://developers.google.com/maps/documentation/javascript/overlays#Markers [C#端程式碼] public Form1(){   InitializeComponent();   if (File.Exists(AppDomain.CurrentDomain.BaseDirectory +...