Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
2
Question by jbrialon · Jun 08, 2017 at 12:54 PM · maproute

Mapbox with Unity, draw a route from a GPX/KML

Hello,

i'm doing an experiment with Unity and I'm trying to draw a Route from a GPX/KML on a mapbox terrain-rgb map, so far the map is displaying fine: http://take.ms/ZP68Y

but I have no idea where to start to draw a route, there is not so much documentation about it or ressources anyone could help ?

thanks in advance

Jeremy

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by markusekblad · Sep 14, 2017 at 05:12 PM

Did you find an answer to this somewhere? Trying to implement this right now myself but I can't find any guides or documentation.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by jbrialon · Sep 15, 2017 at 08:01 AM

nop, I gave up :(

let me know if you find how to do it

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by RavenLiquid · Feb 02, 2018 at 11:58 AM

I'm currently looking in to drawing lines on the map, but the documentation is indeed quite worthless in how to stuff.

I'm using a QuadMap by the way as I want it to zoom and scroll.

What I'm currently doing is using a line renderer, this takes a list of Vector3 positions to draw the line. To get the positions you need to get your coordinates which are stored in your GPS log, so either look for a lib that parses that or do it your self to get your list of coordinates.

Once you have your list, you can use the GeoToWorldPosition to convert your lat/lon to a Unity World position. You can use the one on the map component (this takes a Vector2d with your lat/lon) or on the Conversions (this also needs the map center and map scale).

Loop through this so you have a list of Vector3s and the do SetPositions on the line renderer. Also don't forget to set positionCount on the renderer as this doesn't take it from the SetPositions input length automatically.

Now fo the issues I have with this method. When moving the map around the line seems to lag behind the map (it needs to update each frame as the map position changes in World space when moving). It seems to work better when zooming. Another issue is that the height information is incorrect quite often. Even when using the tiles to query the height data for a coordinate.

It would be much better if there was an option to affix these things to the map itself so the position is at least auto synced with the map. Zooming might be more difficult.

I hope this helps you and @jbrialon

If you find some better ways to do some of this stuff let me know.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

108 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Which unity asset would you recommend me for map, route and geolocation 0 Answers

Help with dynamic loading or occlusion culling in scenes on 2D metroidvania? 1 Answer

map box tutorials for beginers. 0 Answers

Hello. How to make random items on map? 2 Answers

how can can input map in Unity3D like "Pokemon go" 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges