React-google-maps: mapTypes is undefined

Created on 9 May 2017  路  4Comments  路  Source: tomchentw/react-google-maps

How can i get a reference to map object, i have this code
HandleMapMounted (map) { this._map = map; var customMapType = new google.maps. StyleMapType (style_file, styledMapOptions); this._map.mapTypes.set (MY_MAPTYPE_ID, customMapType); }
Shows that maptypes is undefined

Most helpful comment

defaultExtraMapTypes={[
['custom_style', new google.maps.StyledMapType([
{
elementType: 'labels',
stylers: [{visibility: 'off'}]
}
], {
name: 'Custom Style'
})]
]}
defaultMapTypeId={'custom_style'}
>

All 4 comments

Please refer to Getting Help section in the README.

@victors141, did you end up getting an answer or a work around for this? I need to use it and can't find anything that will work.

defaultExtraMapTypes={[
['custom_style', new google.maps.StyledMapType([
{
elementType: 'labels',
stylers: [{visibility: 'off'}]
}
], {
name: 'Custom Style'
})]
]}
defaultMapTypeId={'custom_style'}
>

@MINZHE-XU Thanks for the example!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

timkraut picture timkraut  路  3Comments

farhan687 picture farhan687  路  3Comments

tahir-masood1 picture tahir-masood1  路  4Comments

johnantoni picture johnantoni  路  3Comments

MrSaints picture MrSaints  路  3Comments