使用ngmap在多个标记之间绘制折线

时间:2015-12-13 15:41:16

标签: ng-map

如何使用ngmap在多个标记之间绘制折线?

这是使用ng repeat

的动态标记的ngmap代码
<div map-lazy-load="http://maps.google.com/maps/api/js" map-lazy-load-params="{{googleMapsUrl}}" class="fullmap">
<map center="{{mapCenter.lat}},{{mapCenter.lng}}" zoom="{{mapCenter.zoom}}" pan-control="true" scrollwheel="false" default-style="false"  >
    <custom-control id="searchCtrl" position="TOP_CENTER" index="1" on-click="doSearch()">
        <button>Search</button>
    </custom-control>
    <marker ng-repeat="pos in positions" position="{{pos.latitude}}, {{pos.longitude}}"
            title="({{pos.deviceTime| date:'medium'}}) GPS: {{pos.latitude}}/{{pos.longitude}}, Speed: {{pos.speed}}, Course: {{pos.course}}"
            id="pos{{pos.id}}"
            icon="{{'assets/green.png'}}"
            visible="true">
    </marker>
</map>
</div>

1 个答案:

答案 0 :(得分:0)

this link

找到答案

所以,我只需要在形状指令

中为路径创建纬度和经度的数组对象

HTML

#define TEXTURE_ELEMENTS_COUNT 2
ID3D11ShaderResourceView* m_textures[TEXTURE_ELEMENTS_COUNT];
for (int i = 0; i <= TEXTURE_ELEMENTS_COUNT; i++) {
    m_textures[i] = 0;
}
//some code here
for (int i = 1; i <= (TEXTURE_ELEMENTS_COUNT - 1); i++) {
    m_textures[i]->Release(); //it throws an exception right here, but I can't figure out why, I tried change `i` to zero, but it still throws it.
    m_textures[i] = 0;
}

控制器

<shape name="polyline" path="{{path}}" geodesic="true" stroke-color="#FF0000" stroke-opacity="1.0" stroke-weight="2"></shape>