respec / leaflet.wfs-t Goto Github PK
View Code? Open in Web Editor NEWLeaflet plug-in for WFS Transactional (WFS-T) support
License: BSD 2-Clause "Simplified" License
Leaflet plug-in for WFS Transactional (WFS-T) support
License: BSD 2-Clause "Simplified" License
featureNS is used, but the expected value is the featurePrefix
i.e. normally I would configure:
layers.drawnItems = L.wfst(null,{
// Required
url : '/geoserver/opengeo/wfs',
featureNS : 'http://opengeo.org',
featureType : 'countries',
primaryKeyField: 'id'
}).addTo(map);
but this is what works (featurePrefix instead of featureNS):
layers.drawnItems = L.wfst(null,{
// Required
url : '/geoserver/opengeo/wfs',
featureNS : 'opengeo',
featureType : 'countries',
primaryKeyField: 'id'
}).addTo(map);
I read in the description that it should implement a GML reader, since WFS-T is a GML oriented protocol.
Are there any plans to for this implementation any time soon ?
Just tried on a local geoserver instance and I get this CORS issue. Using such address with WMS TileLayers works without problems:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:8080/geoserver/wfs?. This can be fixed by moving the resource to the same domain or enabling CORS.
Since the web content is on port 80, I need to specify the full address. Which seem to work fine with other layers. Any idea ho to solve or circumvent this issue at the plugin level (i.e. without enabling CORS?).
Request fails and I get the message at line 109 & 110 of current dist as output.
Hi Michael
I loaded a very simple point layer into my leaflet page with your plugin and leaflet draw all running fine with both markers showing.
When try and add a marker to the map I get: "no geometry field" error in the console.
Here's my code for the page.
Matt
'
<script type="text/javascript" src="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.js"></script>
<script type="text/javascript" src="http://localhost/leaflet/leaflet/Leaflet.draw/dist/leaflet.draw.js"></script>
<script type="text/javascript" src="http://localhost/leaflet.wfs-t/js/leaflet.gml.js"></script>
<script type="text/javascript" src="http://localhost/leaflet.wfs-t/js/leaflet.wfst.js"></script>
<script type="text/javascript" src="js/map.js"></script>
</head>
<body>
<div id="map"></div>
<script type="text/javascript">
// Load the map with the initMap function in map.js
var map = L.map('map').setView([50.370, -4.14], 14);
var basemap = L.tileLayer('http://{s}.tile.cloudmade.com/a8ed148d84c2438ba62c2742cac051ae/33356/256/{z}/{x}/{y}.png', {
maxZoom: 18,
attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://cloudmade.com">CloudMade</a>'
}).addTo(map);
layers = {};
layers.drawnItems = L.wfst(null,{
url : 'http://localhost/geoserver/wfs',
featureNS : 'cite',
featureType : 'points',
primaryKeyField: 'gid',
}).addTo(map);
var drawControl = new L.Control.Draw({
edit: {
featureGroup: layers.drawnItems
}
});
map.addControl(drawControl);
map.on('draw:created', function (e) {
layers.drawnItems.addLayer(e.layer);
});
map.on('draw:edited', function (e) {
layers.drawnItems.wfstSave(e.layers);
});
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.