How to get two lat-lon points in jsp to find shortest path on click of openlayer map

المشرف العام

Administrator
طاقم الإدارة
i'm using geoserver,postgresql and here openlayer. i'm trying to retrieve two lat-lon point(for point A and point B) on clicking of map. This code is working only to retrieve one lat-lon. i want to use this for 4(two lat-lon) points in jsp file. that i will use to find shortest path between that points. So how can i perform this??

OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, { defaultHandlerOptions: { 'single': true, 'double': false, 'pixelTolerance': 0, 'stopSingle': false, 'stopDouble': false }, initialize: function(options) { this.handlerOptions = OpenLayers.Util.extend( {}, this.defaultHandlerOptions ); OpenLayers.Control.prototype.initialize.apply( this, arguments ); this.handler = new OpenLayers.Handler.Click( this, { 'click': this.trigger }, this.handlerOptions ); }, trigger: function(e) { var lonlat = map.getLonLatFromPixel(e.xy); var lat=lonlat.lat; var lon=lonlat.lon; //alert("You clicked near " + lonlat.lat + " N, " + // + lonlat.lon + " E"); window.location.replace("atobNewForPath.jsp?lat="+lat+"&lon="+lon); } }); var click = new OpenLayers.Control.Click(); map.addControl(click); click.activate();In body tag



أكثر...
 
أعلى