I am adding WFS points to Leaflet map, but don't see them on the map, however in console I see that all points I wanted is here with all properties and geometries. But the problem here is in projection I think.
So I define a projection like this
var crs = new L.Proj.CRS('EPSG:3301',
'+proj=lcc +lat_1=59.33333333333334 +lat_2=58 +lat_0=57.51755393055556 +lon_0=24 +x_0=500000 +y_0=6375000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs',
{
resolutions: [
1024, 512, 256, 128,
64, 32, 16, 8, 4, 2, 1, 0.5
],
transformation: new L.Transformation(1, -40500, -1, 7017000)
});
Then define a map
var map = L.map('map', {
layers: [hybrid,base,satellite],
continuousWorld: true,
maxZoom: 13,
minZoom: 1,
maxBounds: new L.latLngBounds([
[56.42, 20.87],
[60.9, 29.23]
]),
crs: crs
}
);
And then ask Geoserver for points
var geojsonLayer = new L.GeoJSON();
function getJson(data) {
console.log(data)
geojsonLayer.addData(data);
}
$.ajax({
url: "http://loom-gis.geo.ut.ee:8040/geoserver/ermas/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=ermas:testdata_geopnt&maxFeatures=50&outputFormat=text/javascript",
dataType: 'jsonp',
jsonpCallback: 'parseResponse',
success: getJson
});
This is what I get in console:
Object {type: "FeatureCollection", totalFeatures: 36458, features: Array[50], crs: Object}
Could someone help me please?