doudao7511 2015-04-29 16:54
浏览 64

谷歌地图从mysql表缓慢映射

I am reading mysql tables and generating an xml file: https://developers.google.com/maps/articles/phpsqlajax_v3

To generate the map, I generate a JSON file.

My database contains several thousand records, this generates 5000+ lines of JSON.

The mysql query result is different depending on many settings, and needs to be accessible from multiple users at same time.

Each time the map is loaded, this json file is parsed, then the map loads in about 3-6 seconds (depend the client device).

Is there a way to speed up this process, or an alternative way to achieve the same result?

Any suggestion is welcome.

// Cédric

  • 写回答

1条回答 默认 最新

  • douwenpin0428 2015-04-29 17:52
    关注

    I don't see enough detail to give any specific advice, but if I were in a situation like this my first question would be: Is it absolutely necessary to load up the entire 5K lines of JSON each time the map is loaded? What kind of data does the JSON contain that's being needed all at once? The whole point of AJAX is to load parts of resources only as they're resources (and Google Maps is a master at this); I'd look for some way to only load the highest-level or most-immediate data when the map first loads, then load in more as needed later on.

    评论

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?