Reputation: 151
Here is what I'm importing:
import React, { useState, useEffect, useRef } from 'react';
import 'ol/ol.css';
import ExtentInteraction from 'ol/interaction/Extent';
import { Map, View } from 'ol';
import { OSM } from 'ol/source';
import { Tile as TileLayer } from 'ol/layer';
import { shiftKeyOnly } from 'ol/events/condition';
import { Stroke, Style } from 'ol/style';
import { Control, defaults as defaultControls } from 'ol/control';
Here is my usage of ol that is being flagged:
const controls = map.getControls();
controls.forEach((control) => {
console.log(control instanceof ol.control.Zoom);
});
The error is that ol is undefined. Is this an issue with my import or is there another reference that needs to be used?
Upvotes: 1
Views: 1060