小编Kyl*_* VG的帖子

Typescript eslint 标记“google”未为 google.maps.Marker[] 定义

const google = window.google;
        let markers: google.maps.Marker[] = [];
        // Listen for the event fired when the user selects a prediction and retrieve
        // more details for that place.
        searchBox.addListener("places_changed", () => {
            const places = searchBox.getPlaces();

            if (places.length === 0) {
                return;
            }

            // Clear out the old markers.
            markers.forEach((marker) => {
                marker.setMap(null);
            });
            markers = [];

            // For each place, get the icon, name and location.
            const bounds = new google.maps.LatLngBounds();
            places.forEach((place) => {
                if (!place.geometry || !place.geometry.location) …
Run Code Online (Sandbox Code Playgroud)

google-maps typescript eslint

4
推荐指数
1
解决办法
1528
查看次数

标签 统计

eslint ×1

google-maps ×1

typescript ×1