0

我运行了 MapQuest 示例代码:

 MQA.EventUtil.observe(window, 'load', function() {
 /*Create an object for options*/
 var options={
   elt:document.getElementById('map'),       /*ID of element on the page where you want the map added*/
   zoom:10,                                  /*initial zoom level of the map*/
   latLng:{lat:39.743943, lng:-105.020089},  /*center of map in latitude/longitude */
   mtype:'map',                              /*map type (map)*/
   bestFitMargin:0,                          /*margin offset from the map viewport when applying a bestfit on shapes*/
   zoomOnDoubleClick:true                    /*zoom in when double-clicking on map*/
 };

 /*Construct an instance of MQA.TileMap with the options object*/
 window.map = new MQA.TileMap(options);
 });

并生成了一张地图。但是查看生成的 HTML,并不清楚地图数据的来源是什么。我期待可能是 iFrame 或图像,但我也没有看到:

<div id="map" style="width: 800px; height: 300px; position: relative;">
<div style="width: 800px; height: 300px; z-index: 0; overflow: hidden; background: none repeat scroll 0% 0% rgb(255, 255, 255); position: relative; top: 0px; left: 0px; cursor: -moz-grab;">
<div class="mqa-display" style="position: absolute; z-index: 0;">
<div class="mqa-zl mqa-zl100 mqa-zlf" style="position: absolute; z-index: 100; cursor: default;">
<div class="mqa-zl mqa-zl0 mqa-zlgl" style="position: absolute; z-index: 0; left: 400px; top: 150px;">
<div class="mqa-zl mqa-zl10 mqa-zlf" style="position: absolute; z-index: 22;">
<div class="mqa-zl mqa-zl1000 mqa-zlf" style="position: absolute; z-index: 1000;">
<div class="mqa-zl mqa-zl1000 mqa-zlgl" style="position: absolute; z-index: 1000; left: 400px; top: 150px;">
<div class="mqa-zl mqa-zl5 mqa-zlgl" style="position: absolute; z-index: 5; left: 400px; top: 150px;">
</div>
</div>
</div>

该 HTML 如何代表科罗拉多州的详细地图?

谢谢

4

1 回答 1

3

您看到的由 JavaScript API 生成的地图是由一组地图图像图块创建的,这些图块已下载并组装以创建地图。当用户平移和放大/缩小时,会下载其他图块。

地图切片由位于世界各地的各种服务器缓存和托管。

于 2013-09-26T22:17:28.577 回答