duanguane1670 2011-07-12 15:21
浏览 42

Google地图标记随机呈现

I have a feature on my site to display a google map of a carpool for a particular hike. There are 3 things that should appear on the map:

  1. Destination spot
  2. Little pictures of cars to indicate drivers
  3. Happy faces to indicate people that need a ride.

What happens is that the happy faces and car icons render at random times. Sometimes only cars appear and sometimes only the happy faces. I am wondering if I am doing something wrong in my AJAX.

Here is an example page. See mid-column on the right side for the carpool map:

http://www.comehike.com/hikes/scheduled_hike.php?hike_id=169

In my <body> tag I am doing this:

<body onload="initialize( <?php echo $hike_id; ?> ); placeHikeStartMarker( <?php echo $hike_id; ?> );  placeCarpoolPassengersMarkers( <?php echo $hike_id; ?> ); placeCarpoolDriversMarkers( <?php echo $hike_id; ?> );">

Is there anything in the nature of AJAX of google maps that would cause this sort of inconsistency since the calls are a-synchronous?

  • 写回答

1条回答 默认 最新

  • duanmi1900 2011-07-25 22:27
    关注

    I don't think it is a problem with the Google Maps API as I've never seen anything like this.

    I'm more likely to suspect a problem with your server or code.

    It looks like your server is returning the results fine (in the AJAX requests) - so it isn't overloaded or timing out.

    Are you adding markers to the same array, and possibly over-writing them?

    评论

报告相同问题?

悬赏问题

  • ¥15 微信小程序协议怎么写
  • ¥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 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看