hik-map
Version:
- 提炼自浙江海康智联科技有限公司中后台产品的交互语言和视觉风格。 - 开箱即用的高质量 Vue 组件。
16 lines (15 loc) • 491 B
text/typescript
const getWeather = function (mapInstance: any, city: string, type: string, callBack) {
mapInstance.AMap.plugin('AMap.Weather', function () {
const weather = new mapInstance.AMap.Weather();
if (type === 'Live') {
weather.getLive(city, function (err, data) {
callBack(data);
});
} else if (type === 'Forecast') {
weather.getForecast(city, function (err, data) {
callBack(data);
});
}
});
};
export default getWeather;