API Google map
-
I try use the aplicattion of google maps. (ma-map) and I want created a marker with the possition of two point (Latitud and longitud). The problem is when I put that the point change with the select watch-list. In this case the point="designer.points | filter:{name:'Latitud'}:true | maFirst" and i don't know that I have to put in the field position the my marker.
If I get the point normal I use the field point of my ma-get-point-value.
Can you help me?
-
@Fabier I'm sorry you are not making much sense to me. Maybe post some code snippets so I can get an idea of what you are trying to achieve.
-
<div class="ma-designer-root" id="6cb5c3d4-93b8-41ba-8581-ad1113d45c1b" style="width: 1024px; height: 100px; position: relative; background-color: rgb(0, 1, 13); top: auto;" ma-center="true"> <ma-watch-list-select id="23f7841d-5b31-4fdf-9f38-ea4f48035dde" ng-model="designer.watchList" parameters="designer.parameters" style="position: absolute; left: 0px; top: 30px;"></ma-watch-list-select> </div> <div id="59a9760c-d268-493f-a571-f3eefc1aa5d3" style="position: absolute; left: 333px; top: 0px; width: 362.875px; height: 34px; font-size: 160%; font-weight: 800;">UBICACIÓN NEVERAS COCA COLA</div> <ma-get-point-value id="20f80a36-3588-4830-a32a-46b2221184ec" style="position: absolute; left: 234.266px; top: 55px;" ng-bind="Latitud" point="designer.points | filter:{name:'Latitud'}:true | maFirst"></ma-get-point-value> <ma-get-point-value id="b2678643-51e6-47ba-acd9-af48e14ba9c5" style="position: absolute; left: 398px; top: 56px;" ng-bind="longitud" point="designer.points | filter:{name:'Longitud'}:true | maFirst"></ma-get-point-value> <ma-map id="b6d480d5-6d25-4f07-8726-f585b45ffdfa" lat="4.68401" long="-74.051" map-type="roadmap" info-window-theme="dark" desktop-height="600px" mobile-height="450px" style="width: 683.813px; height: 709px;" zoom="10"> <marker position="{{Latitud.value}}, {{Longitud.value}}" on-click="$parent.$ctrl.setOutputData('DP_b6a0d213-4056-4cd0-9504-8707edb1fc82')"></marker> </ma-map>
-
@jared-wiltshire said in API Google map:
I'm sorry you are not making much sense to me. Maybe post some code snippets so I can get an idea of what you are trying to achieve.
this is my code, I want to create a map with a marker but this marker have to get the position agree a the value the watch-list
-
OK I can see what you are trying to do, your code looks correct. What exactly is the issue? Can you explain more what is going wrong?
Are your Latitud and Longitud points numeric or string? Are they in decimal format if they are strings?
-
I would encourage you to put some tags into your code to inspect the value of variables and ensure they are correct. e.g.
<pre ng-bind="designer.points | filter:{name:'Latitud'}:true | maFirst | json"></pre> <pre>{{Latitud.value}}, {{Longitud.value}}</pre>
-
@jared-wiltshire Thanks, The probles is that my market don't get the values. This is a point numeric.
-
@Fabier Did you check the values of your variables on the page using the method I posted above? I can't make any more suggestions unless you give me some feedback. The only thing I can think of is removing the space between your lat and long.
-
@jared-wiltshire, yes, I can use your sentence and this is the response:
{
"enabled": true,
"templateXid": null,
"loggingProperties": {
"tolerance": 0,
"discardExtremeValues": false,
"discardLowLimit": -1.7976931348623157e+308,
"discardHighLimit": 1.7976931348623157e+308,
"loggingType": "ON_CHANGE",
"intervalLoggingType": "AVERAGE",
"intervalLoggingPeriod": {
"periods": 1,
"type": "MINUTES"
},
"overrideIntervalLoggingSamples": false,
"intervalLoggingSampleWindowSize": 0,
"cacheSize": 1
},
"textRenderer": {
"useUnitAsSuffix": true,
"unit": "",
"renderedUnit": "",
"format": "0.00000",
"suffix": "",
"type": "textRendererAnalog"
},
"chartRenderer": {
"timePeriod": {
"periods": 1,
"type": "DAYS"
},
"type": "chartRendererImage"
},
"modelType": "DATA_POINT",
"tags": null,
"validationMessages": [],
"id": 27,
"useIntegralUnit": false,
"useRenderedUnit": false,
"deviceName": "Trataminto_Dato",
"dataSourceId": 3,
"setPermission": "",
"chartColour": "",
"rollup": "NONE",
"plotType": "SPLINE",
"purgeOverride": false,
"purgePeriod": {
"periods": 1,
"type": "YEARS"
},
"pointLocator": {
"modelType": "PL.SCRIPTING",
"varName": "Lat",
"dataType": "NUMERIC",
"settable": true,
"relinquishable": false
},
"dataSourceXid": "TD_2C58D7",
"readPermission": "",
"dataSourceName": "Trataminto_Dato",
"unit": "",
"renderedUnit": "",
"pointFolderId": 0,
"integralUnit": "s",
"name": "Latitud",
"xid": "DP_b6a0d213-4056-4cd0-9504-8707edb1fc82",
"lastPayload": {
"xid": "DP_b6a0d213-4056-4cd0-9504-8707edb1fc82",
"event": "UPDATE",
"value": {
"dataType": "NUMERIC",
"value": 4.6840744,
"timestamp": 1519846997000,
"annotation": null
},
"renderedValue": "4,68407 ",
"convertedValue": 4.6840744,
"enabled": true,
"attributes": {}
},
"value": 4.6840744,
"time": 1519846997000,
"convertedValue": 4.6840744,
"renderedValue": "4,68407 ",
"unreliable": false
}
, -
How Can I get the value of latitud an longitud in my marker:
<marker position=xxxxx,xxxxx on-click="$parent.$ctrl.setOutputData('DP_b6a0d213-4056-4cd0-9504-8707edb1fc82')"></marker>
-
@Fabier you have to use the tools I gave you to try and figure out what is happening. I can't do it for you.
You did not post what
<pre>{{Latitud.value}}, {{Longitud.value}}</pre>
displays. You have to check each of your variables and see if they have the correct value.If you use the exact same code with a static value in the position attribute does it display the marker?
-
@jared-wiltshire when I post <pre>{{Latitud.value}}, {{Longitud.value}}</pre> the result is "," I don't get the values "Latitud" and "longitud".
When I used <pre ng-bind="designer.points | filter:{name:'Latitud'}:true | maFirst | json"></pre>.
The result was the one presented in the top of the forum.
-
@fabier said in API Google map:
ng-bind="longitud"
I just noticed this in your code. This is wrong. I don't know where you got that from. Do not use ng-bind with
<ma-get-point-value>
, please read the documentation - YOUR_MANGO_URL/ui/docs/ng-mango/ma-get-point-valueTry this -
<marker position="{{(designer.points | filter:{name:'Latitud'}:true | maFirst).value}}, {{(designer.points | filter:{name:'Longitud'}:true | maFirst).value}}" on-click="$parent.$ctrl.setOutputData('DP_b6a0d213-4056-4cd0-9504-8707edb1fc82')"></marker>
-
@jared-wiltshire Thank you very much. Now I can see the point.