wildsong / ol-react Goto Github PK
View Code? Open in Web Editor NEWThis project forked from richardhills/ol-react
React bindings for OpenLayers
License: MIT License
This project forked from richardhills/ol-react
React bindings for OpenLayers
License: MIT License
BingMaps don't show up for me, I created an apiKey and made sure it's getting passed to OL5.
I don't use BingMaps so I am not too worried about it today.
I would like to add a geojson vector source to the component "layer.Vector".
I started to make a really simple example:
var style = {
image: {
type: 'circle',
radius: 4,
fill: { color: [100,100,100, 0.5] },
stroke: { color: 'green', width: 1 }
}
}
var point = new Point(
transform([-1.49, 49], 'EPSG:4326', 'EPSG:3857')
);
var pointFeature = new Feature(point);
var vectorSource = new VectorSource({
projection: 'EPSG:4326'
});
vectorSource.addFeatures([pointFeature]);
return (
<div className="container">
<Map view={<View resolution={10000} center={[0, 0]}/>}>
<layer.Tile source="OSM"/>
<layer.Vector name="Display" source={vectorSource} style={style}/>
</Map>
</div>
);
But I get only the OSM TileLayer, there no "Point" and I get also an error:
GET http://localhost:8000/undefined0/query/?f=json&returnGeometry=true&spatialRel=esriSpatialRelIntersects&geometry=%7B%22xmin%22%3A-10018754.171394622%2C%22ymin%22%3A-5009377.085697312%2C%22xmax%22%3A-5009377.085697311%2C%22ymax%22%3A-9.313225746154785e-10&geometryType=esriGeometryEnvelope&outFields=*&callback=__jp0 net::ERR_ABORTED 404 (Not Found)
Is there any solution to display a geojson with the layer.Vector component ?
Curious to know if you have any plans to add openlayers Types to this?
Hello,
I checked your project and https://github.com/SirMcPotato/react-openlayers (this specific fork which is based on [email protected])
the approach is nearly the same, but as you are working hard on your project. I wanted to know => If I should start working with your project or react-openlayers.
I really like what where you are going with this and would love to make it work for my project. I tried building with ol5 (I need to use ol5) but keep running into an issue where CollectionContext is failing.
The specific error I have been getting is:
Uncaught TypeError: Cannot read property 'push' of undefined at tile.js:12 at commitHookEffectList (react-dom.development.js:19986) at commitPassiveHookEffects (react-dom.development.js:20016) at HTMLUnknownElement.callCallback (react-dom.development.js:347)and at Object.invokeGuardedCallbackDev (react-dom.development.js:397) at invokeGuardedCallback (react-dom.development.js:454) at flushPassiveEffectsImpl (react-dom.development.js:22868) at unstable_runWithPriority (scheduler.development.js:643) at runWithPriority$2 (react-dom.development.js:11305) at flushPassiveEffects (react-dom.development.js:22841)
undefinined in this case referring to layerCollection from
const layerCollection = useContext(CollectionContext);
in the Tile component. I dont think this has anything to do with ol5. Not sure what is going on there.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.