在圈子标记内搜索 [英] Search inside circle markers

查看:140
本文介绍了在圈子标记内搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用圆圈中心的半径和位置作为参数来搜索圆圈内的标记。有人可以帮我对这个搜索有多严重。

I need to do a search for markers that are within a circle using as parameters the radius and position of the center of the circle. Someone can help me on how serious this search.

推荐答案

概念:


  1. 创建一组要搜索的标记

  2. 迭代标记数组,计算每个标记与中心点之间的距离,使用几何图形库computeDistanceBetween()
    函数

  3. 将该距离与圆的半径进行比较,如果小于半径,则标记位于圆内,否则位于圆外。
  1. make an array of the markers you want to search
  2. iterate through the array of markers calculating the distance between each marker and the center point using the geometry library computeDistanceBetween() function
  3. compare that distance to the radius of the circle, if it is less than the radius, the marker is inside the circle, otherwise it is outside the circle.

示例(以地理编码地址为中心点)

example (with center point from geocoded address)

这篇关于在圈子标记内搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆