Search Unity

MapNav - Geolocation Toolkit [RELEASED]

Discussion in 'Assets and Asset Store' started by 8volution, Jan 18, 2014.

?

Which of these two possible usages of MapNav you find more useful/interesting?

Poll closed Feb 26, 2014.
  1. Develop GPS, map-based game/app where a map is visible to end-user in order to overlay Unity content

    6 vote(s)
    50.0%
  2. Create Parallel World game/app with custom scenery/content that can be navigated via GPS (no map)

    6 vote(s)
    50.0%
  1. crag

    crag

    Joined:
    Dec 13, 2013
    Posts:
    145
    This is component based off his "game": http://sonicmaps.org/
    I am planning on a future release with it as well. I am sure there are others.
     
    8volution likes this.
  2. ali_farooq

    ali_farooq

    Joined:
    Sep 8, 2014
    Posts:
    18
    how we can extract or restrict the specific part of map in mapnav like if we only want to take the map of England specific town or city. so i have a problem that how and which algorithm we use in unity 3D development to extract only specific area or town map in our mobile application.
     
  3. 8volution

    8volution

    Joined:
    Nov 14, 2012
    Posts:
    88
    Hi Ali_farooq,

    You could disable online maps using the MapNav inspector ("Disable Map" option), and include an offline map image for that area only instead. You will need to create a secondary plane with your specific map texture and position/resize this object using the SetGeolocation/GetGeolocation method described in the MapNav manual. The trick for that is to temporally set the new plane's material transparency to 50% so you can compare it with the online version to adjust its position and scale (you can switch off online maps afterwards).

    The great thing about this solution is that your users will no longer need an internet connection in order to use your app/game, but just an enabled GPS sensor.

    Please send me a PM if you need further help implementing your map solution.
     
    Last edited: Sep 9, 2014
  4. ali_farooq

    ali_farooq

    Joined:
    Sep 8, 2014
    Posts:
    18
    thank you 8volution.
    Can you please tell me the hardware limitation and response time of mapnav.
     
  5. 8volution

    8volution

    Joined:
    Nov 14, 2012
    Posts:
    88
    There are no special hardware limitations beyond the current Unity system requirements.
    By default, MapNav is optimised for mobile devices with only 16 draw calls and very high FPS (frames per second) on most devices.
    Furthermore, when using online maps, download times will depend on how fast is your internet connection and the maps provider's servers (e.g. Google servers are considerably faster than OSM).
    The GPS location data can be updated every frame if needed (update rate is 0.1s by default).

    I hope it helps.
     
  6. crag

    crag

    Joined:
    Dec 13, 2013
    Posts:
    145
    I've been meaning to ask, in your experience, what update rate offered the best mapnav performance and battery performance so far? (I doubled mine to 0.2 but have not run it until my battery emptied)
     
  7. vincenzo79

    vincenzo79

    Joined:
    Sep 16, 2014
    Posts:
    1
    it's possible to geolocalize an object at runtime using MapNav toolkit?. If yes, how can I use SetGeolocation/GetGeolocation scripts to do that. Sorry for my English.
    Regards
     
  8. crag

    crag

    Joined:
    Dec 13, 2013
    Posts:
    145
    Some pseudocode:
    Code (JavaScript):
    1. var setScript : SetGeolocation;
    2.  
    3. // awake
    4. setScript = gameObject.GetComponent(SetGeolocation);
    5.  
    6. // setter
    7. setScript.lat = 64.500000;
    8. setScript.lon = -17.000000;
    9. setScript.orientation = 180.0;
    Code (JavaScript):
    1. var getScript : GetGeolocation;
    2.  
    3. // awake
    4. getScript = gameObject.GetComponent(GetGeolocation);
    5.  
    6. // getter
    7. var latitude = getScript.lat;
    8. var longitude = getScript.lon;
    9. var orientation = getScript.orientation;
     
  9. MTA

    MTA

    Joined:
    Sep 8, 2014
    Posts:
    5
    Is there any mapnav geolocation tool kit alternative any other asset?
     
  10. 8volution

    8volution

    Joined:
    Nov 14, 2012
    Posts:
    88
    I am happy to announce that MapNav 1.3.3 has just been released, including a new Distance Calculator and Path Renderer tool (GetDistance.cs).

    As you might know, it is not possible to measure real-world distances on a Mercator Projection (that being used by Google Maps and other maps providers) by simply using Unity's Vector3.Distance method, given the distortion introduced at different latitudes by the 2D projection of the globe.

    This new tool, however, provides accurate and automatic calculations of real-world distances between multiple waypoints (gameObjects) using spherical geometry, avoiding the aforementioned issue.

    A basic path renderer implementation has also been included in order to visualise your routes.

    Thanks again for your support.
    Recursive Arts
     
    tarek-hentati likes this.
  11. tarek-hentati

    tarek-hentati

    Joined:
    Sep 30, 2014
    Posts:
    4
    Hi, I think that your plugin is inetresting. I have 2 simple questions if you reply to them i will be very greatful :
    1 - Is it possible to draw a rout between two points in the map?
    2 - Is it possible to locate a place with its adress ( for example a search bar to write in it the adress or the name of the place and to be auto-geolocated in this place)
     
  12. 8volution

    8volution

    Joined:
    Nov 14, 2012
    Posts:
    88
    Hi Tarek,
    The latest "GetDistance" script allows you to provide an array of waypoints and it will automatically draw the corresponding legs for your route using these points.
    Adresses are not currently not implemented but it can easily be done using Google's geocoding API.
    (I'll add it to the list of new features for the next update release).

    Cheers.
     
    tarek-hentati likes this.
  13. tarek-hentati

    tarek-hentati

    Joined:
    Sep 30, 2014
    Posts:
    4
    Thanks for responding.
    So if I understand, I can't draw a route between two points as does Google maps for exemple( it knows the streets and draws to you the path to take). I must give an array of points to draw the route that a car or person can take to arrive to his destination.
    if this possibility is not covered can I use the google maps Api to cover this use case??
    Thanks in advance.
     
  14. 8volution

    8volution

    Joined:
    Nov 14, 2012
    Posts:
    88
    You could use the Google Directions API for that, as it will return a JSON/XML file, including the latitude/longitude for all waypoints in your route. Then, you'll need to translate those locations into Vector3 positions using the SetGeolocation.cs script and pass the result to the GetDistance.cs script in order to draw the route and calculate distances if necessary.
     
    tarek-hentati and crag like this.
  15. tarek-hentati

    tarek-hentati

    Joined:
    Sep 30, 2014
    Posts:
    4
    Hi,
    I'm doing the benchmarking of plugins that offer geolocation. Your plugin seems interesting, but one of my need is that supports google map. As I see your in your demo video it works with the mapQuest and OpenStreetMap. Is your plugin supports google map?? If Yes, can you give me a video to demonstrate this need. I must argument my benchmarking.
    Thanks in advance.
     
  16. 8volution

    8volution

    Joined:
    Nov 14, 2012
    Posts:
    88
    Hi Tarek,

    Thanks for your query.

    Google Maps is indeed fully supported.
    Most of the images being used in our promo video, are actually from Google Maps.
    Instructions to activate the Google Service can be found here.

    I hope it helps.
     
  17. 8volution

    8volution

    Joined:
    Nov 14, 2012
    Posts:
    88
  18. Paul_B

    Paul_B

    Joined:
    Nov 5, 2014
    Posts:
    3
    Is the bug related to the fact that the sample project will not run on iPhone or iPad? When booting up the sample scene on either device I get the "Unable to initialize location services." message and the app shuts down. This is regardless of what I have the GPS simulator set to. I am downloading the patch right now and will see if that helps...
     
  19. Paul_B

    Paul_B

    Joined:
    Nov 5, 2014
    Posts:
    3
    On the positive side, the 3D sample app now loads and runs on a device, so the location services issue is all set, but when you click "zoom", you see the "updating" message and it then crashes. The error is in the "WWWConnection.mm - (void)cleanup" method, line 112. It throws a EXC_BAD_ACCESS error.
     
  20. Strogg2313

    Strogg2313

    Joined:
    Jan 2, 2014
    Posts:
    9
    Hello!Would anyone mind helping me out,cause i always get map error 400:bad request.Please help! :)
     
  21. 8volution

    8volution

    Joined:
    Nov 14, 2012
    Posts:
    88
    Hello Strogg213,
    If you contact support@recursivearts.com describing your issue, I will be happy to help.
     
  22. Duffybm

    Duffybm

    Joined:
    Nov 27, 2014
    Posts:
    1
    looks like a really really great product. Just have one question:

    If I make a 3D model representative of the real world to be used by a mobile user in that area in real-life, how would you suggest I use this app to better guide my user through the model? As in, how would the 3d model know the coordinates so that the gps coordinates coming from the user are displayed correctly through the app?


    Thanks :)
     
  23. 8volution

    8volution

    Joined:
    Nov 14, 2012
    Posts:
    88
    Hi Duffybm,

    Your 3D model can be positioned in the scene using the GetGeolcation/SetGeolocation scripts included in MapNav. You can read more about this method in the MapNav Operation Manual available here. The user's position is also automatically calculated and displayed using the incoming GPS data, so no further steps are needed for this.

    If you have any other questions please contact info@recursivearts.com and I will try my best to help.
     
  24. Jay-Santos

    Jay-Santos

    Unity Technologies

    Joined:
    Jul 9, 2012
    Posts:
    4
    Why does SetGeolocation changes the scale of its GameObject?

    I'm asking because whenever I instantiated a new GameObject that uses SetGeolocation, the script forces the GO's scale to (0,0,0).

    Commenting the setLocalScale lines withing SetGeolocation fixed it but I just want to check if I haven't broken anything.

    Thanks!
     
  25. 8volution

    8volution

    Joined:
    Nov 14, 2012
    Posts:
    88
    Hello Jay,

    The SetGeolocation script is usually used in conjunction with the GetGeolocation script that temporally stores the GO's transform data as Player Preferences so it can be copied/pasted.
    When used directly, sometimes the scale values are zeroed because of a old/empty stored value. Your solution is fine, but it won't let you set the object scale automatically. A suggest using the following code instead (SetGelocation script):

    Code (CSharp):
    1. //Set local object scale
    2. if(transform.localScale != Vector3.zero)
    3.      transform.localScale = new Vector3(scaleX, scaleY, scaleZ);
    This fix has been included for next update release. I hope it helps.
     
  26. ChristianLoew

    ChristianLoew

    Joined:
    Dec 16, 2014
    Posts:
    1
    Hi there!

    I'm trying to get MapNav working on Windows Phone 8.1, unfortunately, the (unity) app crashes on the phone.

    Is WP8.1 already supported? If no, when will it be?

    Thanks

    PS, here a Console-Out of Visual Studio, running the app on the phone (connected via usb):

    UPDATE:
    Solved it - works fine now :) It was necessary to allow the project access to the Phone's Location and Internet Service in Visual Studio (modify .appxmanifest-File)
     
    Last edited: Dec 16, 2014
    8volution likes this.
  27. NashTech

    NashTech

    Joined:
    Jun 14, 2013
    Posts:
    2
    Hello there,
    I'm having a problem switching between map types !. Is there a setting I have to do before I run the program?
    Regards
    L.B
     
  28. 8volution

    8volution

    Joined:
    Nov 14, 2012
    Posts:
    88
    Hi LittleB,
    The map type can be selected from the main mapnav inspector (mapnav.cs), and during runtime using the sample GUI buttons provided. What maps provider are you currently using? The following code examples should enable map type selection for Google Maps, Bing Maps, etc:
    http://recursivearts.com/mapnav/faq.html

    If you are still experiencing any issues please contact support@recursivearts.com and I will be happy to help.

    Thank you and happy new year.
     
  29. doukOmega

    doukOmega

    Joined:
    Dec 31, 2014
    Posts:
    12
    Hello there ,

    Really nice plugin which finally was bought by the company i work for to be used in a project.

    1) Is there a possibility to have a local map with the use of the plugin and the mapquest data?

    2) Is there an easy way to implement a navigation within unity using this plugin? I would really appreciate if you could give a walkthrough about that as it is the only thing that it is missing to make the plugin perfect.

    3) If i have my own maps been uploaded in a server and then with the classic way i download them in the application per user demand. Is it easy to geolocate the maps and use them with them as my offline data maps provider? Or if you have gone through a solution what / where would you suggest we should start looking for?

    Really much appreciated the hard work you have done.
     
  30. 8volution

    8volution

    Joined:
    Nov 14, 2012
    Posts:
    88
    Hello doukOmega,

    Thanks very much for your positive feedback.

    You can use your own offline map images and geolocate them using the GetGeoloation/SetGeolocation method detailed in the MapNav Operation Manual. You'll just need to scale your images (placed on a second plane object) to match the online ones and disable online maps later using the corresponding checkbox in the MapNav.cs inspector. I use this method myself when developing applications for an specific location where an internet connection is not available.

    Regarding navigation, we have already implemented the Google Directions API and should be available in 1-2 weeks with the new update release.
     
  31. doukOmega

    doukOmega

    Joined:
    Dec 31, 2014
    Posts:
    12
    One Question i have for the offline images that i would like to know.

    Is there a way to load vector graphics in unity and handle them for the offline maps ?

    If not we may need then more versions of scaled images for he appication to have build in ?
     
  32. jrpascucci

    jrpascucci

    Joined:
    Feb 15, 2014
    Posts:
    2
    Do we think this will work with Unity 5 beta?
     
  33. MTA

    MTA

    Joined:
    Sep 8, 2014
    Posts:
    5
    MapNav work on Pakistan?
     
  34. 8volution

    8volution

    Joined:
    Nov 14, 2012
    Posts:
    88
    Hi MTA,
    Yes, it should work fine in Pakistan. I would also recommend activating Google maps as it has better coverage than MapQuest for your area. See details here.
     
  35. ali_farooq

    ali_farooq

    Joined:
    Sep 8, 2014
    Posts:
    18
    I am using the map object from the prefabs folder, i had also changed the app key from mapquest but i am still getting the black surface. Why?
     
  36. ali_farooq

    ali_farooq

    Joined:
    Sep 8, 2014
    Posts:
    18
    i didn't find the MapNavInspector.cs file in scripts
     
  37. 8volution

    8volution

    Joined:
    Nov 14, 2012
    Posts:
    88
    Hi ai_farooq,
    The MapNavInspector.cs script is located in the "MapNav/Editor" folder.
    Regarding your issue with a black map tile, are you getting any errors in the console (e.g. error 400)? MapQuest Appkey usually need one or two hours to activate.
    If are you still experiencing this, please contact support@recursivearts.com so we can follow your case further.
    Thanks.
     
  38. MTA

    MTA

    Joined:
    Sep 8, 2014
    Posts:
    5
    Thanx 8volution for replying.
    Does i need an app key for google maps like as for a mapquest, if yes how i get it?
     
  39. ali_farooq

    ali_farooq

    Joined:
    Sep 8, 2014
    Posts:
    18
    Yes i am getting a 400 error in console not with mapquest but when i used google maps error occurs.
     
  40. 8volution

    8volution

    Joined:
    Nov 14, 2012
    Posts:
    88
  41. Nsomnia

    Nsomnia

    Joined:
    Sep 26, 2014
    Posts:
    27
    Would be this a good idea for a world sized map system in a game? (Map menu, zoom from continent level all the way down to building size detail in 10-15 steps? Or does anyone suggest a different solution.
     
  42. 8volution

    8volution

    Joined:
    Nov 14, 2012
    Posts:
    88
    Hi Nsomnia,

    That sounds viable. As long as you don't require a spheric representation of the globe, MapNav will offer you zoom levels between 0 (entire world) and 20 (street level) using a mercator projection. If you would like to reduce the number of steps between those two extremes, this could be easily implemented in the MapNav.cs script. Just let me know if you need further support with that and I'll be happy to advise.
     
    Last edited: Feb 9, 2015
  43. Nsomnia

    Nsomnia

    Joined:
    Sep 26, 2014
    Posts:
    27
    Nope the player will be in an infinite ocean all the time except when coming to port. I just need a graphical representation of where the player is exactly aka... a map, and with no noticable lag between enabling the map and going back to the player view! Theres little information and even fewer assets for this. Will consider this asset. Thank you!


    The auto center option would be great too just a simple boolean button on the UI. My only question is this workable offline with my own map system (Im not using google maps or openstreetmap I'd be using some form of my own map whether it be 2d mesh based or something... think every AAA game that has a world map view button, not just a simple minimap. )
     
    Last edited: Feb 10, 2015
  44. 8volution

    8volution

    Joined:
    Nov 14, 2012
    Posts:
    88
    Yes, you can work without online maps by checking the "Disable Maps" option in the MapNav script inspector. That will let you use your own imagery and still track the user's GPS position accordingly. You will basically be navigating your custom virtual 3D scenery using real world positions (is that what you're looking for, right?)

    Hope you keep us posted about developments in your game. It sounds really intriguing and interesting!
     
  45. Nsomnia

    Nsomnia

    Joined:
    Sep 26, 2014
    Posts:
    27
    Basically! I went over to a fellow developer (much bigger studio) who develops apps for our citys transit system. He had a copy of mapnav that he had tested out for making an audio tour of our city halls history. (I hope this isnt offensive, I couldnt find a web-player demo, and I hate buying without looking) It seems with enough re-coding it might be viable. You may have a customer.

    Last question I promise: I didnt have long to look at the code how does it aqquire the users position? I would be obviously not be using a real world GPS receiver but perhaps coding one, or at the very least a float or double each for longitude and latitude shouldnt be hard based on my ships course and speed, and then use that in your GPS emulator functions?

    And since it loads the map so fast and "sets" your lat/long so fast, im sure if I cached that at runtime opening and closing the map in the game wouldnt take more than 250ms. (Thats my target)

    Using WASD to move around the empty map and seeing the pointer move around with a course heading and lat/long is perfect. And im already thinking about using the altitude function as my depth meter (submarine game).

    The only issue I saw when he was showing me it was the pointer didnt get smaller or bigger when zoming in and out, would be easy enough to resize that at each zoom level. Also every time the map had to be updated (zooming, or going off the edge of the screen) took about 750-1000ms to update the map. That is WAY too slow. Again thinking having a cached map would take that down considerably.

    My biggest turn off at this point is while the player is doing his thing say attacking a russian destroyer time is at 1x but during long cruises the game play (and thus the minimap) is 32x faster than regular time and while in map mode during long long cruises we hope to have at least 4096x time compression thus having "updating map" would kill time compression.

    Very intriqued, as you can understand a game studio of 3 people cant go around blowing 70 bucks on every asset that *might* work. But this is the most promising so far.

    So basically, I would have to somehow (map openstreetmap?) map out the entire worlds oceans and coastlines as a mesh plane sticking to Unitys vert limit (although I bet I could tile them and your scripts would work just fine with a little work) and then use it with all your scripts on top, for what im looking for? Im trying to emulate this more or less exactly:




    (The navigation and attack maps from Silent Hunter 4 and 5 and even 3 (3 used a grid based system).

    While your asset is the only solution that "seems" viable so far. It also seems to have some drawbacks when it comes to adapting it to my purpose.
     
    Last edited: Feb 10, 2015
  46. Geneon

    Geneon

    Joined:
    Mar 8, 2014
    Posts:
    3
    I have purchased MapNav and implemented it, it is working nicely for my needs, my only question so for is, if I had two networked players (I understand that their geoPositions would be synced obviously) would their transform positions also coordinate?

    For example, If I had one player at lon/lat (1,1) and another player at lon/lat (1,1) would they share the same "XYZ" transform position in unity?

    I'm sorry if that is a confusing question, the reason i'm asking is because it would be nice to be able to use the transform position to place and move assets and then just have them update based of that logic and not longitude and latitude.

    Thanks,
    Geneon
     
  47. 8volution

    8volution

    Joined:
    Nov 14, 2012
    Posts:
    88
    Hi Nsomnia,
    If you want the user pointer to get smaller o bigger when zooming in/out just disable or detach the FixPlaneASpect.cs script in the User(Pointer) game object.
    A cached map will definitely increase loading times dramatically, but if you are currently using the default MapQuest maps provider I recommend using Google's service instead, as their servers are considerably faster (X5 or more).
    Steps to activate google maps are explained here: http://recursivearts.com/mapnav/faq.html
     
    Last edited: Feb 14, 2015
  48. 8volution

    8volution

    Joined:
    Nov 14, 2012
    Posts:
    88
    Hello Geneon,
    Vector3 positions for geolocated objects (including Player) are always taken from a local frame of reference that is set when you first start your game/app. So the first GPS position obtained will be Vector(0,0,0) and everything else is measured from that initial point. Therefore, in a networked game, two objects sharing the same GPS latitude and longitude coordinates won't necessarily share the same Vector3 (Unity World coordinates) as they might have started at different locations.
    I hope that answers your question.
     
  49. Geneon

    Geneon

    Joined:
    Mar 8, 2014
    Posts:
    3
    It does indeed.
    Thanks
     
  50. DMeville

    DMeville

    Joined:
    May 5, 2013
    Posts:
    418
    I've just picked up this asset and having a bit of trouble getting it to work:
    1 - Testing on both android and the editor, (with GPS emulation enabled on the editor) I keep getting the error 500 Internal Server Error". I've tried both the default key and creating my own MapQuest key, neither seem to work.

    2 - The map renders pink on android. I've read this happened to another user but I've double checked and the mapTile does have a shader, and is set in the mesh renderer.

    Looking forward to getting this working! :)