First time here? Check out the FAQ!
Hello, I would like to make a route of points and track down if a car passes through them. From car I get location every minute.I have object for car-location, and with 'gmarker' I show it on map. I have different object for route point , I want to show these points but with a different picture for marker. This is code for 'carLog' :
<gmaps version="3.29" id="gmap" satellite="true"
hybrid="true" hflex="1" vflex="1" showLargeCtrl="true"
showTypeCtrl="true" lat="@load(vm.latt)" lng="@load(vm.lngg)" zoom="16"
onMapClick="@command('openBoardPopup')"
children="@load(vm.carLog)">
<template name="children">
<gmarker lat="@load(each.latitude)"
lng="@load(each.longitude)"
iconImage="@load('carMarker.png')">
</gmarker>
</template>
</gmaps>
Perhaps I need a second layer to add list of 'routePoit' with 'routePoitMarker.png' for marker. I tried with another 'template' but it did not work. I was thinking for object that keeps the data for 'carLog' and 'routePoint' and with field to check is car or is route coordinates but I don`t think this is the smart solution.
Hi how about adding resolving the icon from the carLog item. All you need is a getIcon method to return the specific icon for this marker.
e.g.:
<gmaps version="3.29" id="gmap" satellite="true"
hybrid="true" hflex="1" vflex="1" showLargeCtrl="true"
showTypeCtrl="true" lat="@load(vm.latt)" lng="@load(vm.lngg)" zoom="16"
onMapClick="@command('openBoardPopup')"
children="@load(vm.carLog)">
<template name="children">
<gmarker lat="@load(each.latitude)"
lng="@load(each.longitude)"
iconImage="@load(each.icon)">
</gmarker>
</template>
</gmaps>
Asked: 2018-08-14 21:45:28 +0800
Seen: 17 times
Last updated: Aug 30 '18