我的谷歌地图被配置以显示蓝色位置标记。谷歌地图不显示蓝色位置标记(在Sitecore的网站时)
我的地图中使用以下.KML文件(只是XML数据描述的地方显示通过谷歌地图API蓝色位置标记),我与一个普通的老XMLHttpRequest对象加载。
我的问题是,当我从外部来源,如“http://xyz.com/kumedplaces.kml”加载.kml文件,它的工作原理,但是当我存储它,并尝试加载它从我的Sitecore的网站运行在本地服务器上,谷歌地图对象不加载/显示在地图上的蓝色位置标记。
下面是我在我的.js文件从做.KML文件加载地址后:
<div id="map" style="width: 400px; height: 300px"></div>
var kmlUrl = "http://xyz.com/kumedplaces.kml"; works
var kmlUrl = "/js/heart/kumedplaces.kml"; doesn't work
var geoXml = new GGeoXml(kmlUrl);
map.addOverlay(geoXml);
和我做了我的地方,以确保我的本地.KML文件双重检查的方式被正确加载我.KML文件
样品:
<?xml version="1.0" encoding="utf-8" ?>
<kml xmlns="http://earth.google.com/kml/2.1">
<Document>
<name>University of Kansas Hospital Locations</name>
<description>The various buildings around the city that comprise the University of Kansas Hospital</description>
<Style id="randomColorIcon">
<IconStyle>
<color>ff00ff00</color>
<colorMode>random</colorMode>
<scale>1.1</scale>
<Icon>
<href>http://maps.google.com/mapfiles/kml/pal3/icon21.png</href>
</Icon>
</IconStyle>
</Style>
<Placemark id="kumed">
<name>The University of Kansas Hospital</name>
<description>
Part of the Kansas University Medical Center complex.
3901 Rainbow Blvd, Kansas City, KS 66160
</description>
<address>3901 Rainbow Blvd, Kansas City, KS 66160</address>
<phonenumber>xxxxxxx</phonenumber>
<ExtendedData></ExtendedData>
<!--<styleUrl>#randomColorIcon</styleUrl>-->
<Point>
<coordinates>-94.608800,39.0558241</coordinates>
</Point>
</Placemark>
</Document>
</kml>