UNPKG

@ioniczoo/eagle-map-component

Version:

Map Component for Ionic

85 lines 3.43 kB
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; import { Component, Input, NgModule } from '@angular/core'; /** * Águia Map Component * * Google Map Component for Ionic * * @example * ``` html * <zoo-map width="640" height="640" zoom="8" origin="-12.9730401,-38.50230399999998" destination="-12.9730401,-38.50230399999998"></zoo-map> * ``` */ var MapComponent = /** @class */ (function () { function MapComponent() { /** * @Input {string} Latitude and longitude, separated by a comma. Default: "-12.9730401,-38.50230399999998" */ this.origin = "-12.9730401,-38.50230399999998"; /** * @Input {string} Latitude and longitude, separated by a comma. Default: "-12.9730401,-38.50230399999998" */ this.destination = "-12.9730401,-38.50230399999998"; /** * @Input {string} Image width. Default: '640' */ this.width = '640'; /** * @Input {string} Image height. Default: '640' */ this.height = '640'; /** * @Input {string} Image zoom. Default: '12' */ this.zoom = '12'; } __decorate([ Input(), __metadata("design:type", String) ], MapComponent.prototype, "origin", void 0); __decorate([ Input(), __metadata("design:type", String) ], MapComponent.prototype, "destination", void 0); __decorate([ Input(), __metadata("design:type", String) ], MapComponent.prototype, "width", void 0); __decorate([ Input(), __metadata("design:type", String) ], MapComponent.prototype, "height", void 0); __decorate([ Input(), __metadata("design:type", String) ], MapComponent.prototype, "zoom", void 0); MapComponent = __decorate([ Component({ selector: 'zoo-map', template: "<div class=\"cover\" [ngStyle]=\"{'background-image': 'url(https://maps.googleapis.com/maps/api/staticmap?markers=color:green%7Clabel:S%7C' + origin.split(',')[0] + ',' + origin.split(',')[1] + '&markers=color:red%7Clabel:C%7C' + destination.split(',')[0] + ',' + destination.split(',')[1] + '&size=' + width + 'x' + height + '&zoom=' + zoom + '&maptype=roadmap'}\"></div>" }) ], MapComponent); return MapComponent; }()); export { MapComponent }; var MapComponentModule = /** @class */ (function () { function MapComponentModule() { } MapComponentModule = __decorate([ NgModule({ declarations: [MapComponent], exports: [MapComponent] }) ], MapComponentModule); return MapComponentModule; }()); export { MapComponentModule }; //# sourceMappingURL=index.js.map