Guest User

Untitled

a guest
Jan 17th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. import { Component, OnInit } from '@angular/core';
  2.  
  3. import { FirebaseAuthService } from '../auth/firebase-auth.service';
  4.  
  5. import { AfterContentInit, Directive, EventEmitter, OnChanges, OnDestroy,
  6. SimpleChanges, Input, Output } from '@angular/core';
  7. import { Subscription } from 'rxjs/Subscription';
  8.  
  9. import { LatLng, LatLngLiteral, PolyMouseEvent, PolygonOptions } from '@agm/core/services/google-maps-types';
  10. import { PolygonManager } from '@agm/core/services/managers/polygon-manager';
  11. import {AgmPolygon} from '@agm/core/directives/polygon';
  12.  
  13. @Component({
  14. selector: 'app-map',
  15. templateUrl: './map.component.html',
  16. styleUrls: ['./map.component.css']
  17. })
  18. export class MapComponent implements OnInit {
  19.  
  20. // initial center position for the map
  21. lat: number = 51.673858;
  22. lng: number = 7.815982;
  23. paths: Array<LatLngLiteral> = [
  24. { lat: 0, lng: 10 },
  25. { lat: 0, lng: 20 },
  26. { lat: 10, lng: 20 },
  27. { lat: 10, lng: 10 },
  28. { lat: 0, lng: 10 }
  29. ]
  30. // Nesting paths will create a hole where they overlap;
  31. nestedPaths: Array<Array<LatLngLiteral>> = [[
  32. { lat: 0, lng: 10 },
  33. { lat: 0, lng: 20 },
  34. { lat: 10, lng: 20 },
  35. { lat: 10, lng: 10 },
  36. { lat: 0, lng: 10 }
  37. ], [
  38. { lat: 0, lng: 15 },
  39. { lat: 0, lng: 20 },
  40. { lat: 5, lng: 20 },
  41. { lat: 5, lng: 15 },
  42. { lat: 0, lng: 15 }
  43. ]];
  44. @Input() fillColor: "red";
  45. @Input() visible: boolean;
  46. @Input() strokeColor: "white";
  47. constructor() { }
  48.  
  49. ngOnInit() { }
  50.  
  51. }
  52.  
  53. <agm-map [latitude]="lat" [longitude]="lng">
  54. <agm-polygon [paths]="paths">
  55. </agm-polygon>
Add Comment
Please, Sign In to add comment