Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

custom property with google marker in type script

I'm using type script and getting below error when trying to set custom property with Google marker. Can anyone please advice how to set custom property with Google Map Marker?

Argument of type '{ position: LatLng; map: any; icon: string; zIndex: number; se10: any; }' is not assignable to parameter of type 'MarkerOptions'. Object literal may only specify known properties, and 'se10' does not exist in type 'MarkerOptions'.

The following Javascript code is working well.

var marker = new google.maps.Marker({
            position: new google.maps.LatLng(Number(merchant[lat]), Number(merchant[lng])),
            map: map,
            icon: icon,
            zIndex: zIndex ,
            se10: merchant.se
        });
like image 582
Raj Avatar asked Feb 21 '16 21:02

Raj


People also ask

How do I change a marker on Google Maps?

To edit the marker color, click or tap on the marker icon. When you do that, you can change both the color of the marker and its style. Go for the color or style you want to change and then click OK to see the effect. Click on the button labeled Done to save your new marker color settings.


1 Answers

Got it . below is type script code -

var marker = new google.maps.Marker({
                position: new google.maps.LatLng(Number(merchant[lat]), Number(merchant[lng])),
                map: map,
                icon: icon,
                zIndex: zIndex ,
            });
            marker.set("se10",merchant.se);
like image 125
Raj Avatar answered Oct 30 '22 16:10

Raj