API Google 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.