Is there a way to make a web map with custom areas that display custom info at addresses?

huangapple go评论71阅读模式
英文:

Is there a way to make a web map with custom areas that display custom info at addresses?

问题

我正在尝试为工作制作一张地图,上面标明了不同地区的价格。基本上,我想能够将各个地区添加到地图上,这样如果我搜索一个地址,根据它所在的地区,会告诉我不同的价格。这可能吗?

我尝试过使用谷歌地图API的教程,但只能添加一个没有太多功能的彩色区域。

英文:

I am trying to make a map for work with our prices for different areas. Basically I would like to be able to add areas to a map so that if I search an address depending what area it is in will tell me the various prices. Is this possible?

I have tried using google map API tutorials but can only add a coloured area that doesn't really do much

答案1

得分: 0

这是非常有可能的。将您的区域存储为包含坐标对集合的数组。每个区域都有其定价。您可以使用Google My Maps绘制边界,使用真实世界的GPS坐标。您可以将创建的多边形形状导出为JSON数据。

使用Google Maps API查找街道地址并检索GPS坐标。

使用Point In Polygon类来检查GPS坐标属于哪个多边形(如果有的话),并评估价格。

英文:

This is very possible. Store your areas as an array containing sets of coordinate pairs. Each area with its pricing. You can use Google My Maps to draw the boundaries using real-world GPS coordinates. You can export the polygon shapes you create to JSON data.

Use Google Maps API to lookup a street address and retrieve the GPS coordinates.

Use Point In Polygon class to check which polygon the GPS coordinate belongs in (if any) and assess the price.

huangapple
  • 本文由 发表于 2023年1月9日 09:44:41
  • 转载请务必保留本文链接:https://go.coder-hub.com/75052518.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定