Hello guys如何将文件URL的位置替换为变量?
NgMap.getMap().then(function (map) {
$scope.map = map;
var myParser = new geoXML3.parser({ map: map });
myParser.parse('cta.kml');
});
myParser.parse只接受网址而不是变量?这有可能吗?
var result = "<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
<!-- Data derived from:
Ed Knittel - || tastypopsicle.com
Feel free to use this file for your own purposes.
Just leave the comments and credits when doing so.
-->
<Document>
<name>Chicago Transit Map</name>
<description>Chicago Transit Authority train lines</description>
<Style id="blueLine">
<LineStyle>
<color>ffff0000</color>
<width>4</width>
</LineStyle>
</Style>
<Style id="redLine">
<LineStyle>
<color>ff0000ff</color>" ........ so on...
如何替换myParser.parse(结果)????
即时使用ngMap。
答案 0 :(得分:0)
myParser.parse只接受网址而不是变量?这有可能吗?
没有
NgMap.getMap().then(function (map) {
$scope.map = map;
var myParser = new geoXML3.parser({ map: map });
var myUrl = 'cta.kml';
myParser.parse(myUrl);
});
应该是可能的。
然而:不太确定,如果这是你的问题?