This object is in archive! 

Auto-Import or Import-Push via API/SDK?

Liam Caffrey shared this question 6 years ago
Answered

I'd like to be able to push a KMZ file into Locus Map (i.e. "Import" fom outside the app) or have Locus Map automatically go get a KMZ from a URL and import it automatically setting up folders and toggling import options as required. Is this possible in Locus Map via API or SDK?

Replies (6)

photo
1

Good day Liam,

sorry, I left answer on evening and result is 14 days delay.

Current it is possible to "send" KMZ into Locus over VIEW intent, but it is not possible to predefine (or even skip) options in import dialog.

Depends on what you want to achieve. It may be for example possible to use KML with "network link" over MapItems (so it will dynamically reload data based n frequency defined in network link). Or you may simply put KML into mapItems, display it on the map and on background overwrite this file with new data. Locus Map should detect this change and reload file on map ;).

photo
1

Hi Menion,

At first glance Mapitems might work. I'll look in more detail. Do you have a link to an example of the VIEW intent?

I want to manage the list of tracks/points that a user sees in their Locus Map app. I want to add in new files as necessary, delete old ones, manage the folder names, and import specific files into specific folders so that a user's daily workload is already imported and ready without them having to do anything! Ideally. If I can approximate this process, then that would be helpful.

We could possibly simulate all this using Mapitems and fixed filenames. I'll need to examine it closer. However, I notice that the Add Mapitem -> remote file -> KMZ URL results in the KMZ filename getting hashed into a hashvalue.kmz which kind of removes the usefulness of the filename.

photo
1

Hello,

sample call here. It is based on "intent" so you may dig deeper and copy & paste code from 'ActionFiles' class if you do not want to use API.

Yes, to mee it also looks like "MapItems" may solve your needs. They are quite flexible.

"Hashed names" ... hmm, why you then don't directly write/rename/delete etc. content in Locus/mapItems directory?

photo
1

Your java links look useful. I don't do android/java so i will get a colleague to check this out.

Yes, I can copy the kmz file directly into the Mapitems/GPSies folder and the file is available for import. That's neat, might help but the users are not IT skilled, they won't know anything about copying/pasting kmz files around the device filesystem. We could use your code as a basis to get the kmz from a URL and place it in the Maptiems folder. We would still have to manually import and set up folder names though. Can this or parts of this be automated? Not sure about using the same filename and overwriting. We could have fixed number of predefined folders... hmmm, let me look at this a bit more and try a few things out.

Thank you for your help.

Liam

photo
1

Hello,

hmm maybe one more tip for you: Locus Actions .

You may be able to create for example "zip" file with exact directory structure and content you wants to get to users and with these Locus Actions you may prepare "task" that, when handled by Locus Map app, will download this zip and extract into defined directory (Locus/mapItems for example). Might be useful, but needs some technical skills. This system is used for example in our manual for custom navigation voices (scroll to the bottom and you will see that every voice point to XML file).

Hope this helps,

Menion

photo
1

Yes, that definitely looks very good. I'm sure I can get something useful working with this.

I'm having fun with the voices!! I'm wondering if I edited the contents of the zip to remove, for example, BearLeft.ogg, BearRight.ogg, that these 2 instructions would not get played during navigation (because they are really annoying if you are driving and you just happen to be following a windy road).

Very helpful. Thanks.

Replies have been locked on this page!