Skip to content

Commit

Permalink
fix(marker-kyh): double marker (#413)
Browse files Browse the repository at this point in the history
* Added github actions workflow for aut deployment to .72 server.

* Added github action for S3 deployment.

* Changed to staging. Created branch for staging.

* Retrigger deployment workflow.

* fix(studio): zoom in on ios (#192)

# Summary 

- Fixes #186
- The `load` event isn't firing on NOAH Studio. As such, the `centerListener()` method isn't called which is responsible for the zooming in to the selected place. However, `style.load` do get called. The fix implemented here is to also use the event `style.load` to call the methods that were previously called by upon the firing of the `load` event but only listen to `style.load` once.
  - We need to further investigate **why** `load` doesn't work on Studio in iOS but works in KYH
- Confirming that only the NOAH Studio is affected by this issue.
 
# Demo

![Kapture 2021-10-05 at 22 49 45](https://user-images.githubusercontent.com/11599005/136047077-d0da7a85-9157-4d01-bae9-07a6039fd9c1.gif)

* ci(netlify): add _redirects file

* S3 Deployment Validation (#198)

* Added if condition to run workflow only on successful PR merge. (#195)

* Checking proper automation workflow. Will revert this small change upon validation. (#196)

* Change deployment trigger. Revert small biblio change. (#199)

* Checking proper automation workflow. Will revert this small change upon validation.

* Changed trigger for deployment workflow. Revert small change to bibliography.

* Cascade dev changes on workflow to prod (#202)

* Added AWS deployment workflow

* fix marker double pin when changing mapstyle

---------

Co-authored-by: pfgoting <pfgoting@gmail.com>
Co-authored-by: Jadurani Davalos <jadurani.davalos@gmail.com>
Co-authored-by: kennethbeoliporada <kennethbeoliporada@gmail.com>
  • Loading branch information
4 people authored Oct 15, 2024
1 parent 73386e8 commit cd4ec73
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ import { GoogleAnalyticsService } from 'ngx-google-analytics';
export class MapKyhComponent implements OnInit {
map!: Map;
geolocateControl!: GeolocateControl;
centerMarker!: Marker;
//centerMarker!: Marker;
mapStyle: MapStyle = 'terrain';

kyhLegend: boolean = true;
btnLegend: boolean = false;

private _unsub = new Subject();
private _changeStyle = new Subject();

private centerMarker: mapboxgl.Marker | null = null;
constructor(
private gaService: GoogleAnalyticsService,
private mapService: MapService,
Expand Down Expand Up @@ -246,7 +246,7 @@ export class MapKyhComponent implements OnInit {

async initMarkers() {
this.centerMarker = new mapboxgl.Marker({
color: '#FF0000',
color: '#4D4C51',
draggable: true,
})
.setLngLat(this.kyhService.currentCoords)
Expand Down Expand Up @@ -380,6 +380,10 @@ export class MapKyhComponent implements OnInit {
this.map.setStyle(environment.mapbox.styles[style]);
this._changeStyle.next();
}
if (this.centerMarker) {
this.centerMarker.remove();
this.centerMarker = null; // Reset the marker
}
}
}

Expand Down

0 comments on commit cd4ec73

Please sign in to comment.