-
Notifications
You must be signed in to change notification settings - Fork 34
Description
Hy,
I am building a live map service with your awesome libary.
What I have realised that uplon not rendering the map component with *ngIf the boundsChange @output can emmit incorrect value. It really hard to debug so let me know for futher steps in order to find the source of the issue.
<div> <x-map *ngIf="screenWidth < 600" class="w-100 mobile-map" #xmap [Options]="_options" [Box]="_box" (BoundsChange)="boundsChange($event)" (MapService)="_processMapService($event)" > <x-map-marker *ngFor="let marker of $searchResult | async" [Latitude]="marker._geoloc.lat" [Longitude]="marker._geoloc.lng" [Title]="marker.company" [IconInfo]="mapIcons.getIcon(marker.type)" > </x-map-marker> </x-map> </div>
Here is the flow of my application:
1.User enters city name, based on the city name I get the center lat-lng (latitude: 52.516667,longitude: 13.4)
2.After I get the center points I wait for the map service to load and when I have the map service accesible I set the center and the zoom with the service.
3.First emission of the boundsChange event emitter is:
center: {latitude: 52.516667000000005, longitude: 0}
maxLatitude: 52.516667000000005
maxLongitude: 180
minLatitude: 52.516667000000005
minLongitude: -180
padding: 0
4.Secound emission is correct:
center: {latitude: 52.51537950312108, longitude: 13.400000000000016}
maxLatitude: 52.851745934581174
maxLongitude: 13.745382690429704
minLatitude: 52.17901307166099
minLongitude: 13.054617309570329
padding: 0
It is clear that the longitudes has some problem, unfortunately sometimes it breaks my app.
Any suggestions ?