• 请不要在回答技术问题时复制粘贴 AI 生成的内容
verfino
V2EX  ›  程序员

做一个功能,心跳方式接收'城市/IP'作为参数,在中国地图上动态高亮显示这个省份

  •  1
     
  •   verfino ·
    helix-dan · Apr 25, 2014 · 4299 views
    This topic created in 4472 days ago, the information mentioned may be changed or developed.
    http://rcmap.hatnote.com/#en,de,ru,ja,es,fr 类似于这种功能。

    datamaps (http://datamaps.github.io/) 没有提供中国的版图,貌似要去下个SVG格式来parse(然后Ruby貌似没有支持不错的lib可用)。


    现在的想法是,解析出一个SVG格式地图,按照规则修改里面的省份标示,然后传入'城市/IP'的参数后匹配一下,高亮显示(但这个过程卡在,解析出一个SVG格式文件上)。

    求思路啊,不知道有没有公司直接提供这种API。
    4 replies    1970-01-01 08:00:00 +08:00
    bearcat001
        1
    bearcat001  
       Apr 25, 2014   ❤️ 1
    我做的时候是拿
    GeoIP https://github.com/maxmind/GeoIP2-php
    和jvectormap https://github.com/bjornd/jvectormap
    供参考~
    walleL
        2
    walleL  
       Apr 25, 2014   ❤️ 1
    verfino
        3
    verfino  
    OP
       Apr 25, 2014
    @bearcat001 谢谢,这个是PHP的库,做完这个需求后去看看,参考一下

    @walleL Orz 帮大忙了 谢谢

    刚刚也找到类似的地图,竟然是一个老外做的!!!
    https://github.com/clemsos/d3-china-map
    香港,大陆的地图都有,今后可能用得上
    wdlth
        4
    wdlth  
       Apr 25, 2014
    我记得高德什么的地图API都有中国版图吧……
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   974 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 19:50 · PVG 03:50 · LAX 12:50 · JFK 15:50
    ♥ Do have faith in what you're doing.