SHARE
TWEET

Untitled

a guest Jun 26th, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var sourceWFS = new ol.source.Vector({
  2.     loader: function (extent) {
  3.         $.ajax('..../geoserver/harry/ows?', {
  4.             type: 'GET',
  5.             data: {
  6.                 service: 'WFS',
  7.                 version: '1.1.0',
  8.                 request: 'GetFeature',
  9.                 typename: 'ABC',
  10.                 srsname: 'EPSG:3857',
  11.                 geometryField:'geometry',
  12.                 bbox: extent.join(',') + ',EPSG:3857'
  13.             }
  14.  
  15.         }).done(function (response) {
  16.             sourceWFS.addFeatures(formatWFS.readFeatures(response));
  17.         });
  18.     },
  19.     strategy: ol.loadingstrategy.tile(ol.tilegrid.createXYZ()),
  20.     strategy: ol.loadingstrategy.bbox,
  21.     projection: 'EPSG:3857',
  22.  
  23. });
  24. var layerWFS = new ol.layer.Vector({
  25.     source: sourceWFS
  26. });
  27.  
  28. var interaction;
  29.  
  30. var interactionSelectPointerMove = new ol.interaction.Select({
  31.     condition: ol.events.condition.pointerMove
  32. });
  33.  
  34. var interactionSelect = new ol.interaction.Select({
  35.  
  36.  
  37.     style: new ol.style.Style({
  38.  
  39.             stroke: new ol.style.Stroke({
  40.                 color: 'rgba(255,0,0,1.0)',
  41.                 width: 1
  42.             }),
  43.             fill: new ol.style.Fill({
  44.                 color: 'rgba(255,0,0,0.5)'
  45.             }),
  46.             text: new ol.style.Text({
  47.                 text:("abcd")
  48.             })
  49.  
  50.  
  51.         })
  52. });
  53.  
  54. var interactionSnap = new ol.interaction.Snap({
  55.     source: layerWFS.getSource()
  56. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top