Skip to main content
Tweeted twitter.com/StackGIS/status/1607707875136212993
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
added 345 characters in body
Source Link

I'm using Leaflet-geoman to draw polygons in my map. But I need to do another thing, in my map I already have some pins, this pin's have a different "id" (pointsgeojson being consulted and that is plotting these black dots. And then I inserted the leaflet-geoman plugin to give users the freedom to create polygons on the map) they represent wells. Basically draw something there.

I was wondering if there isenter image description here

For example: Draw a possibilitypolygon to get only the information inside that polygon.

When using the tool to draw a polygon on the map I canwanted to get the id's of thesewhich black dots but thatdot is inside my polygon?the drawing

enter image description hereenter image description here

These black dotsin short: I have 4 points within my polygon drawing (which does not come from a geojson, the person draws) and I want to get the information from those points that are pins with differentwithin that drawn polygon. Each black dot in this one has an id, and I want to know what is the id of the pins thatpoints are within the space that radiusthe person drew. It's possible?

I'm using Leaflet-geoman to draw polygons in my map. But I need to do another thing, in my map I already have some pins, this pin's have a different "id" (points black on the map) they represent wells.

I was wondering if there is a possibility that I can get the id's of these black dots but that is inside my polygon?

enter image description here

These black dots are pins with different id, I want to know what is the id of the pins that are within that radius. It's possible?

I already have a geojson being consulted and that is plotting these black dots. And then I inserted the leaflet-geoman plugin to give users the freedom to create polygons on the map. Basically draw something there.

enter image description here

For example: Draw a polygon to get only the information inside that polygon.

When using the tool to draw a polygon on the map I wanted to get which black dot is inside the drawing

enter image description here

in short: I have 4 points within my polygon drawing (which does not come from a geojson, the person draws) and I want to get the information from those points that are within that drawn polygon. Each black dot in this one has an id, and I want to know what points are within the space that the person drew.

Title changed, Content Structured, Tag added, Tag deleted
Source Link
Taras
  • 34k
  • 4
  • 73
  • 148

I'm using leafletLeaflet-geoman to draw polygons in my map. But I need to do another thing, in my map I already have some pins, this pin's have ana different id "id" (points black on the map) they representsrepresent wells.

I was wondering if there is a possibility that I can get the id's of these black dots but that areis inside my polygon?

My geoman-leafletLeaflet code:


      map.pm.addControls({
        position: 'topright',
        // drawCircle: false,
        drawMarker: false,
        drawCircleMarker: false,
        drawRectangle: false,
        cutPolygon: false,
        editPolygon: false,
      });
  

      map.pm.addControls({
        position: 'topright',
        // drawCircle: false,
        drawMarker: false,
        drawCircleMarker: false,
        drawRectangle: false,
        cutPolygon: false,
        editPolygon: false,
      });

My black dots on the map code:

  wellheads.forEach(function (d) {
        d.LatLng = new L.latLng(d.latitude, d.longitude);
      });

  const groupWells = g
        .selectAll('g')
        .data(wellheads)
        .enter()
        .append('g')
        .attr('pointer-events', 'visible');

      const points = groupWells
        .append('circle')
        .attr('class', d => {
          if (wellState.selectedWell.guid === d.wellboreGUID) {
            return 'redW';
          } else {
            return 'blackW';
          }
        })
        .attr('id', d => `id-${d.wellboreGUID}`)
        .attr('r', d => {
          if (wellState.selectedWell.guid === d.wellboreGUID) {
            return 1.7;
          } else {
            return 1.0;
          }
        })

  wellheads.forEach(function (d) {
        d.LatLng = new L.latLng(d.latitude, d.longitude);
      });

  const groupWells = g
        .selectAll('g')
        .data(wellheads)
        .enter()
        .append('g')
        .attr('pointer-events', 'visible');

      const points = groupWells
        .append('circle')
        .attr('class', d => {
          if (wellState.selectedWell.guid === d.wellboreGUID) {
            return 'redW';
          } else {
            return 'blackW';
          }
        })
        .attr('id', d => `id-${d.wellboreGUID}`)
        .attr('r', d => {
          if (wellState.selectedWell.guid === d.wellboreGUID) {
            return 1.7;
          } else {
            return 1.0;
          }
        })

I'm using leaflet-geoman to draw polygons in my map. But I need to do another thing, in my map I already have some pins, this pin's have an different id (points black on the map) they represents wells.

I was wondering if there is a possibility that I can get the id's of these black dots but that are inside my polygon?

My geoman-leaflet code:


      map.pm.addControls({
        position: 'topright',
        // drawCircle: false,
        drawMarker: false,
        drawCircleMarker: false,
        drawRectangle: false,
        cutPolygon: false,
        editPolygon: false,
      });
  

My black dots on the map code

  wellheads.forEach(function (d) {
        d.LatLng = new L.latLng(d.latitude, d.longitude);
      });

  const groupWells = g
        .selectAll('g')
        .data(wellheads)
        .enter()
        .append('g')
        .attr('pointer-events', 'visible');

      const points = groupWells
        .append('circle')
        .attr('class', d => {
          if (wellState.selectedWell.guid === d.wellboreGUID) {
            return 'redW';
          } else {
            return 'blackW';
          }
        })
        .attr('id', d => `id-${d.wellboreGUID}`)
        .attr('r', d => {
          if (wellState.selectedWell.guid === d.wellboreGUID) {
            return 1.7;
          } else {
            return 1.0;
          }
        })

I'm using Leaflet-geoman to draw polygons in my map. But I need to do another thing, in my map I already have some pins, this pin's have a different "id" (points black on the map) they represent wells.

I was wondering if there is a possibility that I can get the id's of these black dots but that is inside my polygon?

My geoman-Leaflet code:

      map.pm.addControls({
        position: 'topright',
        // drawCircle: false,
        drawMarker: false,
        drawCircleMarker: false,
        drawRectangle: false,
        cutPolygon: false,
        editPolygon: false,
      });

My black dots on the map code:

  wellheads.forEach(function (d) {
        d.LatLng = new L.latLng(d.latitude, d.longitude);
      });

  const groupWells = g
        .selectAll('g')
        .data(wellheads)
        .enter()
        .append('g')
        .attr('pointer-events', 'visible');

      const points = groupWells
        .append('circle')
        .attr('class', d => {
          if (wellState.selectedWell.guid === d.wellboreGUID) {
            return 'redW';
          } else {
            return 'blackW';
          }
        })
        .attr('id', d => `id-${d.wellboreGUID}`)
        .attr('r', d => {
          if (wellState.selectedWell.guid === d.wellboreGUID) {
            return 1.7;
          } else {
            return 1.0;
          }
        })

edited tags
Link
Loading
statement title; English usage
Source Link
Vince
  • 20.3k
  • 16
  • 48
  • 65
Loading
Source Link
Loading