Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $.ajax({
- url: "/ajax/getPositions",
- dataType: 'json',
- success: function(result) {
- for (var reportID in result) {
- //Store the object at hand.
- var data = result[reportID];
- //Get all the positions and print them onto the vesselpoisition layer.
- var positions = data.positions;
- var listOfPoints = new Array();
- for (var index in positions) {
- var positionData = positions[index];
- var point= wkt.read(positionData.st_astext);
- listOfPoints.push(point.geometry);
- }
- var pointmap = new OpenLayers.Geometry.LineString(listOfPoints);
- vesselPosition.addFeatures(new OpenLayers.Feature.Vector(pointmap));
- };
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement