0
爲空引用例外,我實例StyledMapType的谷歌地圖API在AS3,StyledMapType的
var styles:Array = [
new MapTypeStyle(
MapTypeStyleFeatureType.ALL,
MapTypeStyleElementType.ALL,
[
MapTypeStyleRule.visibility("on"),
MapTypeStyleRule.hue(0xff0000),
MapTypeStyleRule.saturation(100),
MapTypeStyleRule.lightness(-50),
MapTypeStyleRule.gamma(1.0)
]
)
];
var options:StyledMapTypeOptions = new StyledMapTypeOptions({
name: 'Styled map',
alt: 'Style',
minResolution: 2,
maxResolution: 12
});
var styledMapType:StyledMapType = new StyledMapType(styles, options);
我收到此錯誤時:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com.google.maps::StyledMapType()
at com::Main/init()
at com::Main()
但是,當我忽略此行:
var styledMapType:StyledMapType = new StyledMapType(styles, options);
程序運行。請幫助我。我一直在努力尋找解決方案和問題幾個小時。
感謝