Skip to content Skip to sidebar Skip to footer

How To Get All Visible Points In The Map View Bounds In Azure Maps

I've been searching and trying to use a sample of the select point within a polygon example however I am not drawing a new polygon but rather one is already in the map to use as se

Solution 1:

I managed to figure it out...might not be the best but it does what I need it to do!

functionsearchPolygon(searchArea) {
    // Get points visible on mapvar points = pointLayer.getSource();

    if(points){
        var poly = searchArea.shapes[0].toJson();
        points = points.shapes[0].toJson();

        // Calculate all points that are within the polygon area.var ptsWithin = turf.pointsWithinPolygon(points, poly);
    }

    return ptsWithin;
}

Hopefully this will help others needing the same functionality, Cheers! Rick...

Post a Comment for "How To Get All Visible Points In The Map View Bounds In Azure Maps"