Show Google Maps Link

BerndFfm3 years ago

or

[url="www.jagdwetter.com/rettungspunkte/l/Finderwille%20Einsatz%20App/" + latitude + "/" + longitude]Rescue Points[/url]

Greetings Bernd

Token3 years ago

Google Maps/OSM link work fine on a V4.14 server ... maybe you can create a link button right away?
Another request on the topic, can you please take a look at https://www.traccar.org/forums/reply/65274/ - I would need some help there ?!
(if possible in German)

Greetings
Token

GB3 years ago

In the "Attribute" field there is no "Google Maps" in the list of options.
Can I use "raw" (exactly like the image below) which will work?

Note: Traccar Version 4.14

11.jpg

Anton Tananaev3 years ago

You don't have to pick from the list. You can type your own name.

GB3 years ago

Truth! I didn't realize I could type. Thanks.

Has anyone created a quick link?

Mike Mex3 years ago

Hi.
Continuing with the initial configuration (Compute Attribute: Google Maps), I added a javascript rule to show Google Link in app.min.js

if(record.get('name')==='GoogleMaps'&&(!value===fasle))return'\x3ca target\x3d"_blank" href\x3d"'+value+'" \x3e'+'Ver en Google'+'\x3c/a\x3e';

It's work!!!

to ubicate where exactly you need to put this code, first search 'stategeocode' word.

here the complete function reference:

function(value,metaData,record){if('alarm'===record.get('attribute'))metaData.tdCls='view-color-red';else{if(record.get('name')==='GoogleMaps'&&(!value===fasle))return'\x3ca target\x3d"_blank" href\x3d"'+value+'" \x3e'+'Ver en Google'+'\x3c/a\x3e';if(record.get('name')===Strings.positionAddress&&!value)return'\x3ca href\x3d"#" onclick\x3d"Ext.fireEvent(\'stategeocode\')" \x3e'+Strings.sharedShowAddress+'\x3c/a\x3e';if(record.get('name')===Strings.positionImage||record.get('name')===Strings.positionAudio)if(metaData=this.getController().position)if(metaData=
Ext.getStore('Devices').getById(metaData.get('deviceId')))return'\x3ca target\x3d"_blank" href\x3d"/api/media/'+metaData.get('uniqueId')+'/'+value+'" \x3e'+value+'\x3c/a\x3e'}return value}

Hi Mike Mex.

Could you post a print of the final result?
Is it necessary to recompile Traccar for it to work?

Thanks

Alberto3 years ago

Is this still working? I made the changes but the attributes are not showed in the status dashboard

Alberto3 years ago

Forgot my last comment, I had the computed attribute disabled for the device

Ali Razaa year ago

https://www.traccar.org/forums/topic/show-google-maps-link/page/3/#post-69620

@Mike Mex can you please confirm that your method enables hyperlink in computed attributes because I've tried your instruction and it doesn't work.