ajax - Pass coordinates parameters to geoserver pgrouting service from Leaflet wms tile layer -
i've configurated pgrouting service in geoserver, following steps on documentation it's easy accomplish.
reading documentation, existing examples, etc.. i've come undestand how call must made javascript code:
var mylayer = l.tilelayer.wms("http://192.168.0.34:8080/geoserver/pgroutingtest/wms", { layers: 'pgroutingtest:pgroutingtest', format: 'image/png', transparent: true, version: '1.0.0', tiled:true }); map.addlayer(mylayer);
the call ok, no errors returned, no image added map.
my doubt is, how can pass origin , destination coordinates(x1,y1,x2,y2) parameters pgrouting service in order calculate route?
in example pgrouting documentation give us, done follow:
var viewparams = [ 'x1:' + startcoord[0], 'y1:' + startcoord[1], 'x2:' + destcoord[0], 'y2:' + destcoord[1] ]; params.viewparams = viewparams.join(';'); result = new ol.layer.image({ source: new ol.source.imagewms({ url: 'http://localhost:8082/geoserver/pgrouting/wms', params: params }) }); map.addlayer(result);
but example, made openlayers 3. how can achieve leaflet?
Comments
Post a Comment