Невозможно нарисовать полилинию в Angular 7 Bingmap (x-map) - PullRequest
0 голосов
/ 02 июля 2019

Я пытаюсь нарисовать ломаную линию на bingmap в Angular 7, но я могу загрузить карту и создать маркер, но ломаная линия не создается.У меня есть поиск в Google, но я не нашел решения.

Не понимаю, чего мне не хватает.Я попытался добавить на карту.

Я добавил страницу app.component

/// <reference path="../../node_modules/bingmaps/types/MicrosoftMaps/Microsoft.Maps.All.d.ts" />
----other module
import {
  MapModule,
  BingMapAPILoaderConfig, BingMapAPILoader, MapPolylineDirective
} from 'angular-maps';

----other module

@NgModule({
  declarations: [MapBingComponent],
  imports: [MapModule.forRootBing()],
entryComponents: [],
  exports: [],
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
export function BingMapServiceProviderFactory() {
  let bc: BingMapAPILoaderConfig = new BingMapAPILoaderConfig();
  bc.apiKey = "my-key";
  // replace with your bing map key
  // the usage of this key outside this plunker is illegal. 
  bc.branch = "experimental";
  // to use the experimental bing brach. There are some bug fixes for
  // clustering in that branch you will need if you want to use 
  // clustering.
  return new BingMapAPILoader(bc, new WindowRef(), new DocumentRef());
}
<x-map #xmap [Options]="_options" [Box]="_box">
<x-map-polyline [Paths]="path" [StrokeColor]="blue" [StrokeWeight]="10"></x-map-polyline>
</x-map>

import { Component, OnInit } from '@angular/core';
import { Configuration } from '../app.constants';
import {
    IMapOptions, ILatLong
} from 'angular-maps';

/// <reference path="bingmaps/types/MicrosoftMaps/Microsoft.Maps.All.d.ts" />

let PathData: Array<any> = null;

@Component({
    selector: 'virtuoso-map-bing',
  templateUrl: './map-bing.component.html',
  styleUrls: ['./map-bing.component.scss']
})

export class MapBingComponent implements OnInit {
  path: Array<ILatLong> | Array<Array<ILatLong>>;
  constructor() {
    this.path = [{ latitude: -27.153, longitude: 152.9778 },
      { latitude: -27.409, longitude: 153.0763 }
    ];
  }

  ngOnInit() {
  }

  _options: IMapOptions = {
    disableBirdseye: false,
    disableStreetside: false,
    navigationBarMode: 2,
    showMapTypeSelector: true,
    showCopyright: false,
    disableZooming: false,
    showDashboard: true,
  };


}

Я ожидаю ломаную линию на Bing Map.

...