地理地图点击计数器
我正在寻找类似于 clustermaps 等的独立解决方案。
我希望能够通过地理位置绘制对我的页面的访问,就像地图概述一样 谷歌分析的统计数据。
我的应用程序已准备好使用 MaxMid 免费 geolite 数据库,但我无法找到使用 maxmind 结果在地图上绘制坐标的示例。
PHP 也不是我的强项,所以理想情况下我正在寻找示例代码或预制解决方案。
到目前为止我发现的东西,比如集群地图等都需要你链接回他们自己的服务,我需要一个 100% 独立的解决方案。
有人有一些使用 maxmid 来绘制对图表或类似内容的访问的示例代码吗?
提前致谢。
I am looking for a stand alone solution similar to clustermaps, etc.
I want to be able to plot visits to my page via geographic location much like the map overview
statistics on google analytic's.
My application all ready makes use of the MaxMid free geolite database, but I have been unable to find examples of using the maxmind results to plot co-ordinates on a map.
Php is not my strong point either so Ideally I am looking for example code or a pre made solution.
The stuff I have found so far, like cluster maps etc all require you to link back to their own service, I need a 100% stand alone solution.
Does anybody have some example code using maxmid to plot visits to a graph or something similar?
Thanks in advcance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确切的解决方案将取决于您选择的地图的投影[1]。墨卡托与罗宾逊将需要不同的公式。墨卡托非常常见,因此是一个很好的起点。谷歌搜索一下,有很多关于转向纬度和纬度的帖子。长入 x & y 正是关于网络的。
最简单的方法可能是某种嵌入,您可以节省大量数学知识,并可能节省购买地图的费用。 Google 地图允许您将其嵌入到您自己的网站中,但仍可根据需要添加点。
[1] 投影 - 地球是圆的,地图是平的。各种投影是在平坦的表面上表示这个圆形地球的不同尝试。
The exact solution will depend on the projection[1] of the map you choose. Mercator vs Robinson will require different formulas. Mercator is incredibly common, so a good place to start. Googling around there's a bunch of posts about turning lat & long into x & y for exactly this about the web.
The easiest method is probably some sort of embed, you'll save yourself a lot of math as well as potentially buying a map. Google Maps lets you embed it into your own site, but still add points as required.
[1] Projection - The earth is roundish, maps are flat. The various projections are different attempts to represent this round earth on a flat surface.