Using a Google map point to link to a data source in Mango.
-
Hi All
I am building an interface to represent data from various datasources. Currently i choose my datasource from a drop down list in the following manner:
<div layout="row"> <md-input-container flex="" class="no-errors-spacer"> <h2>Choose a device</h2> <md-select ng-model="deviceName" ng-init="deviceName='Generators'"> <md-option ng-value="'Demo_Gen1'">Demo_Gen1</md-option> <md-option ng-value="'Demo_Gen2'">Demo_Gen2</md-option> <md-option ng-value="'Demo_Gen3'">Demo_Gen3</md-option> <md-option ng-value="'Demo_Gen4'">Demo_Gen4</md-option> </md-select> </md-input-container> </div>
This works fine but now I want to use Google maps and specify the Lat and Long of each site using markers. I have achieved this task. My question is how can I link each marker to a specific datasource? Please let me know if I need to post up any additional code.
Thank you
Shivan -
Hello Shivan,
Have you looked at this example <Your_Mango_Localhost>/modules/dashboards/web/mdAdmin/#/dashboard/examples/point-arrays/templating?
I think this will put you on the right track.
-
Hi Shivan,
I think this should be doable depending on how you are implementing the google maps. You will need to find some way to bind in the selected marker from the google maps API into your angular app to set the model 'deviceName'.
It may be helpful to see the full code you are using to implement the google map. I don't know if you are familiar with polymer web components but it there is a google map component which could prove to be useful for this sort of purpose
-
Thanks Woody. I did have a look at templating but that doesn't address my current issue exactly. I am using those methods for pulling across data from datasources and its working well.
Thanks Will for your response. I will spend some time looking into your suggestion and get back to you after some time. Much appreciated.
Regards
Shivan