Friday, 8 July 2016

Show google coordinates in leafLet with WMS Geoserver


I am new to GIS and have a problem with using geo-coordinates which I got from Google. I have some lat, lng data in my database(MSSQL) which I obtained from Google API (I think it should be in 3857 format), however, I needed to create a layer in GeoServer, so I created a view as


   geometry::STGeomFromText('Point(' + CAST(dp.lat AS nvarchar(50)) + ' ' + CAST(dp.lng AS nvarchar(50)) + ')', 3857) AS Expr1

In Geoserver, when adding a layer I use the following setting which I believe there is something wrong with it and I am not sure which Compute shall I click and in what order. enter image description here


In the publishing, I also select point as default style.


and finally in leafLet



 var mywms = L.tileLayer.wms("http://localhost:9090/geoserver/localhost/wms", {
layers: 'localhost:DP_View',
format: 'image/png',
transparent: true,
version: '1.1.0'
,SrsName: 'EPSG:3857'
});
mywms.addTo(map);

They either sit in the middle or on top of the map.





No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...