question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Map sometimes after a some time dont react on events without error

See original GitHub issue

Map after some time dont react on events without any errors. I`m using Angular with {N} html:

<GridLayout id="bookingMapPage" columns="*" rows="auto,auto,*,auto">

  <GridLayout columns="25,*,25" rows="auto" class="searchInput">
    <Label col='0' row='0' text="&#xf041;" class="fa"></Label>
    <TextField col='1' row='0' [(ngModel)]="address" (ngModelChange)="onAddressChanged($event)" (tap)="isSearchTaped=true"></TextField>
    <Label col='2' row='0' text="&#xf00d;" class="fa" (tap)="address=''"></Label>
  </GridLayout>

  <MapView col="0" row="1" rowspan="2" (mapReady)="onMapReady($event)" (coordinateTapped)="mapTapped($event)" (cameraChanged)="onCameraChanged($event)" ></MapView>

  <Button col="0" row="3" text="next" class="submitBtn"></Button>
</GridLayout>
public mapTapped(event) {
    console.log('tapped');
    this.centerMap(event.position);
    this.mapView.removeAllMarkers();
    this.getAdress(event.position);
    this.addMarker({
      location: event.position
    });
  };

  public onCameraChanged(event) {
    console.log('camera');
    let camera = event.camera;
    let position = Position.positionFromLatLng(camera.latitude,camera.longitude);
    this.isCustomLocation = true
    this.getAdress(position);
    this.mapView.removeAllMarkers();
    this.addMarker({
      location: position
    });


  }
private centerMap(position: any) {
    if (!this.mapView || !position) return;
    
    this.isSearchTaped = false;
    this.mapView.latitude = position.latitude;
    this.mapView.longitude = position.longitude;
    this.mapView.zoom = this.cameraZoom;
  }

  private addMarker(args: AddMarkerArgs) {
    console.log(this.mapView);
    if (!this.mapView || !args || !args.location) return;
    let marker = new Marker();
    marker.position = Position.positionFromLatLng(args.location.latitude, args.location.longitude);
    this.mapView.addMarker(marker);
  };

Its look like after some time map dont fire callbacks

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
kvindascrcommented, May 19, 2017

+1 Im also able to reproduce this behavior. On IOS mostly.

0reactions
ADjenkovcommented, May 31, 2017

I confirm that it works on iOS with 2.1.3

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError Handling in React.js for Map Function | Pluralsight
This error occurs because your data is not an array. The .map() function only works with arrays. First, you'll need to confirm your...
Read more >
map is not displaying in browser; no error in console #186
I am using @react-google-maps, the map initially loaded good, i have changed the latitude and longitude using onClick event in GoogleMap using ...
Read more >
React JS - Uncaught TypeError: this.props.data.map is not a ...
It happens because the component is rendered before the async data arrived, you should control before to render. I resolved it in this...
Read more >
My most frequent React errors and how you fix them
I want to share some of the common errors/problems I often encounter in React with solutions on how to overcome each of them....
Read more >
Using setTimeout in React components (including hooks)
Using timeouts in React isn't as straightforward as you may think. In this article, you'll learn how to avoid mistakes when using them...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found