使用緯度/經度的地圖



以下是有關使用緯度/經度的地圖示例。

我們已經在 Google Charts 配置語法 章節中瞭解了用於繪製圖表所用的配置。現讓我們來看一個有關使用緯度/經度的地圖的示例。

示例

app.component.ts

import { Component } from '@angular/core';
@Component({
   selector: 'app-root',
   templateUrl: './app.component.html',
   styleUrls: ['./app.component.css']
})
export class AppComponent {
   title = '';
   type = 'Map';
   data = [
      [37.4232, -122.0853, "Work"],
      [37.4289, -122.1697, "University"],
      [37.6153, -122.3900, "Airport"],
      [37.4422, -122.1731, "Shopping"]
   ];
   columnNames = ["Latitude","Longitude","Name"];
   options = {   
     showTip: true
   };
   width = 550;
   height = 400;
}

結果

驗證結果。

Map Chart using Latitude/Longitude
angular_googlecharts_maps.htm
廣告
© . All rights reserved.