You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
react-openlayers.umd.js:563 Uncaught TypeError: a.V is not a function
at Hv.k.Nf (react-openlayers.umd.js:563)
at eh (react-openlayers.umd.js:558)
at Hv.k.Lf (react-openlayers.umd.js:563)
at react-openlayers.umd.js:562
at Array.forEach (<anonymous>)
at D.k.forEach (react-openlayers.umd.js:460)
at fh.k.Lf (react-openlayers.umd.js:562)
at G.k.hp (react-openlayers.umd.js:702)
at G.<anonymous> (react-openlayers.umd.js:689)
Here is the code...
import React from 'react';
import * as ReactDom from 'react-dom';
import * as ol from 'ol';
import {
interaction, layer, custom, control, //name spaces
Interactions, Overlays, Controls, //group
Map, Layers, Overlay, Util //objects
} from "react-openlayers";
// var iconFeature = new ol.Feature(new ol.geom.Point([0, 0]));
// var source = new ol.source.Vector({features: [iconFeature]});
// var marker = new custom.style.MarkerStyle(
// 'https://openlayers.org/en/v4.0.1/examples/data/icon.png'
// );
export default class MapView extends React.Component {
constructor(props) {
super(props);
}
showPopup = (evt) => {
this.overlayComp.overlay.setPosition(evt.coordinate);
var lonlat = ol.proj.transform(evt.coordinate, 'EPSG:3857', 'EPSG:4326');
this.popupComp.setContents(
`<p>You clicked here:</p><code> ${lonlat[0]}, ${lonlat[1]}</code>`
);
this.popupComp.show();
}
render(){
debugger;
return (
<div>
<Map onClick={this.showPopup}>
<Layers>
<layer.Tile source={new ol.source.Stamen({ layer: 'watercolor' })}/>
</Layers>
<Overlays>
<Overlay ref={comp => this.overlayComp = comp}>
<custom.Popup ref={comp => this.popupComp = comp}>
</custom.Popup>
</Overlay>
</Overlays>
</Map>
</div>
);
}
}
I did notice that the ol npm project has a specific way of importing the modules, and its different than this repo imports them, but I have tried both ways and am at a loss.
Here is the package.json if it helps, note I am using create-react-app:
Im trying to just follow the basic blueprint of the source files but still getting this error...
Also found this question on stackoverflow
Here is the code...
I did notice that the
ol
npm project has a specific way of importing the modules, and its different than this repo imports them, but I have tried both ways and am at a loss.Here is the
package.json
if it helps, note I am usingcreate-react-app
:The text was updated successfully, but these errors were encountered: