0

Gmaps two layers for gmarkers

asked 2018-08-14 21:45:28 +0800

Radoslav86 gravatar image Radoslav86
13 3

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.

delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2018-08-17 15:11:04 +0800

cor3000 gravatar image cor3000
4141 1 7
ZK Team

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>
link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2018-08-14 21:45:28 +0800

Seen: 15 times

Last updated: Aug 30

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More