Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MapStyle incompatable error for MapOptions #617

Closed
iBasit opened this issue Sep 2, 2016 · 3 comments
Closed

MapStyle incompatable error for MapOptions #617

iBasit opened this issue Sep 2, 2016 · 3 comments

Comments

@iBasit
Copy link

iBasit commented Sep 2, 2016

Issue description
Getting incompatible error on runtime. for styles

ERROR in [default] /.../srcNg/app/map/map-styled.directive.ts:27:19 
Argument of type '{ disableDefaultUI: boolean; draggable: boolean; scaleControl: boolean; styles: { "featureType": ...' is not assignable to parameter of type 'MapOptions'.
  Types of property 'styles' are incompatible.
    Type '{ "featureType": string; "stylers": ({ "hue": string; } | { "saturation": number; } | { "lightnes...' is not assignable to type 'MapTypeStyle[]'.
      Type '{ "featureType": string; "stylers": ({ "hue": string; } | { "saturation": number; } | { "lightnes...' is not assignable to type 'MapTypeStyle'.
        Property 'elementType' is missing in type '{ "featureType": string; "stylers": ({ "hue": string; } | { "saturation": number; } | { "lightnes...'.

Steps to reproduce and a minimal demo of the problem

Follow these steps, on the style it is giving error on on featureType and elementType, even if we set thous value, it still gives error and if we don't set it, they still give error.

http://playcode.org/angular-2-typescript-google-maps/

What steps should we try in your demo to see the problem?

Current behavior
errors on build

Expected/desired behavior
no errors on runtime

angular2 & angular2-google-maps version
RC5 and 0.13.0

Other information

@sebholstein
Copy link
Owner

@iBasit you should use the style binding - it's much simpler. But I checked the interface again and noticed that elementType and featureType should be optional. A workaround is to provide 'all' for both values.

@iBasit
Copy link
Author

iBasit commented Sep 23, 2016

Still getting this error on V0.15.0

Argument of type '{ disableDefaultUI: boolean; scrollwheel: boolean; draggable: boolean; scaleControl: boolean; sty...' is not assignable to parameter of type 'MapOptions'.
  Types of property 'styles' are incompatible.
    Type '({ "featureType": string; "elementType": string; "stylers": ({ "saturation": string; } | { "light...' is not assignable to type 'MapTypeStyle[]'.
      Type '{ "featureType": string; "elementType": string; "stylers": ({ "saturation": string; } | { "lightn...' is not assignable to type 'MapTypeStyle'.
        Type '{ "featureType": string; "elementType": string; "stylers": ({ "saturation": string; } | { "lightn...' is not assignable to type 'MapTypeStyle'.
          Types of property 'elementType' are incompatible.
            Type 'string' is not assignable to type '"all" | "geometry" | "geometry.fill" | "geometry.stroke" | "labels" | "labels.icon" | "labels.tex...'.

@erie-e9
Copy link

erie-e9 commented Mar 7, 2017

Still getting this error on V0.17.0

Argument of type '{ disableDefaultUI: boolean; scrollwheel: boolean; draggable: boolean; disableDoubleClickZoom: bo...' is not assignable to parameter of type 'MapOptions'. Types of property 'styles' are incompatible. Type '({ stylers: { saturation: number; }[]; } | { featureType: string; elementType: string; stylers: (...' is not assignable to type 'MapTypeStyle[]'. Type '{ stylers: { saturation: number; }[]; } | { featureType: string; elementType: string; stylers: ({...' is not assignable to type 'MapTypeStyle'. Type '{ featureType: string; elementType: string; stylers: ({ lightness: number; } | { visibility: stri...' is not assignable to type 'MapTypeStyle'. Types of property 'elementType' are incompatible. Type 'string' is not assignable to type '"all" | "geometry" | "geometry.fill" | "geometry.stroke" | "labels" | "labels.icon" | "labels.tex...'. m.setOptions(options);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants