Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

Custom marker id using @capacitor/google-maps

$
0
0

Hi, recently started migrating an old @ionic-native/google-maps Angular project to @capacitor/google-maps, came onto a huge headache. Can’t figure out how to add custom id’s to markers. This is the reference code on how it worked using @ionic-native/google-maps package.

private nestToMarkerOptions(nest: Nest): MarkerOptions {
        const brandID = nest.brand && nest.brand.id && +nest.brand.id < 9 ? nest.brand.id : 6;
        const zoomedOutIconURL = this.imagePreloader.get('assets/images/map/nests-'+ brandID +'/device-zoomed-out.png');
        return {
            position: new LatLng(nest.location.lat, nest.location.lng),
            icon: this.markerIcon(nest),
            nestId: nest.id,
            closeUpIcon: this.markerIcon(nest),
            zoomedOutIcon: {
                flat: true,
                url: zoomedOutIconURL,
                size: {width: 26, height: 26}
            }
        };
    }

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>