谷歌地图API是否支持导入KML文件?
- Google 地图 Javascript API 中支持 KML 与 GeoRSS的哪些功能?
Javascript API 中的 GGeoXML 类使开发人员可以将 KML/KMZ 和 GeoRSS文件叠加在地图的上方。可在此处查看示例。
以下网址记录了 GGeoXML
类当前支持的 KML 记录:
http://code.google.com/apis/kml/documentation/mapsSupport.html
将来可能会向 GGeoXml
类添加对其他地理空间特征的支持。回去重看或者保持对 Google地理开发人员博客的更新信息的关注。
- 在使用 Google 地图 JavaScript API 里的 GGeoXML时,正常显示所需的 KML 的大小和复杂性有什么限制?
以下网址记录了使用 GGeoXML
类时 KML 的显示大小和复杂性限制:
http://code.google.com/apis/kml/documentation/mapsSupport.html
谷歌地图API是否可以在本地开发或者本地使用?
如果您在本地驱动器(file://) 上开发,则 Google 地图 Javascript API 中会跳过密钥检查,且 Google MapsAPI(Flash 版)中限制更少。另请注意,用 Google Maps API(Flash版)在本地驱动器上开发将导致图块上带有“调试”字样。如果您在本地主机上开发,您需要注册用于 http://localhost的密钥。
http://code.google.com/intl/zh-CN/apis/maps/faq.html
我使用自己的谷歌帐号申请了一个http://localhost的密钥。 如下:
Your key is:
ABQIAAAA1csAp-aDWf6a7askdMwVpxT2yXp_ZAY8_ufC3CFXhHIE1NvwkxR54MozQKipNcZCTwoLWsZ7FjdCmA
Note:for more information on the API key system, consult http://code.google.com/apis/maps/faq.html#keysystem.
How you use your key depends on what Maps API product or serviceyou use. Your key is valid for use within the entire family ofGoogle Maps API solutions. The following examples show how to useyour key within the Maps API product family.
JavaScript Maps API Example
Within the JavaScript Maps API, place the key within the scripttag when you load the API:
... // Note: you will need to replace the sensor parameter below with either an explicit true or false value. <script src="http://maps.google.com/maps?file=api&v=2&sensor=true_or_false&key=ABQIAAAA1csAp-aDWf6a7askdMwVpxT2yXp_ZAY8_ufC3CFXhHIE1NvwkxR54MozQKipNcZCTwoLWsZ7FjdCmA" type="text/javascript"></script>...
See Loading the Maps API in the JavaScript Maps API documentationfor more information.
Maps API for Flash Example
Within the Maps API for Flash, you may place the key within anMXML declaration, declare it directly within code as aMap.key
property, or as a flashVars
property within the HTML container. A sample MXML declaration isshown below.
... <maps:Map xmlns:maps="com.google.maps.*" id="map" mapevent_mapready="onMapReady(event)" width="100%" height="100%" key="ABQIAAAA1csAp-aDWf6a7askdMwVpxT2yXp_ZAY8_ufC3CFXhHIE1NvwkxR54MozQKipNcZCTwoLWsZ7FjdCmA"/>...
See Declaring Maps in the Maps API for Flash documentation for moreinformation.
HTTP Service Example
Within a Maps API HTTP Service, such asthe StaticMaps API or GeocodingService, place the key directly in the request URL:
http://maps.google.com/maps/geo?q=1600+Amphitheatre+Parkway,+Mountain+View,+CA&output=json&oe=utf8&sensor=true_or_false&key=ABQIAAAA1csAp-aDWf6a7askdMwVpxT2yXp_ZAY8_ufC3CFXhHIE1NvwkxR54MozQKipNcZCTwoLWsZ7FjdCmA
Note that for all examples, you mustreplace the sensor
parameter with a valid value, basedon whether your application uses a sensor to determine a user'slocation. Check out the API documentation for more information.