dongyu1125 2010-02-21 05:52
浏览 78
已采纳

根据信息着色地图(使用谷歌地图api或其他api)

I am trying to build an application that will use an Api like google maps api (or any other api for maps) in order to color the states depending on some information that change. So for example, let's say I am going to color states green if they have more than 5 people online and this information will change every minute, how can i use some maps api in order to color the states using javascript, php, and other web development languages but not flash?

If you need more explanation please let me know and i will edit the post to include more information.

This is (NOT) a homework question so please provide as much information and code as possible.

Thanks!

  • 写回答

2条回答 默认 最新

  • dqjjw04440 2010-02-21 06:06
    关注

    The google map api allows you to change the color of the polygon in your code. You would need to have the geometries of the states so you can draw them as a layer on top of google maps

    I would say have your PHP script generate a new KML file every interval. Here is an example of using KML directly in the google API http://code.google.com/apis/maps/documentation/examples/geoxml-kml.html

    Found under the service examples here: http://code.google.com/apis/maps/documentation/examples/index.html

    I am sure there is probably a KML library in PHO.

    You would just do an ajax call on a timer and re-pull KML at the interval you would like. Clear the map after pulling and then re-draw the new KML.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘