Topic: Set Map On Part of Canvas

hi
two days ago i bought this great library ..
but right now i have 2 Q.
1- is there any way to set the map on a part of the canvas.
   i have a canvas
   inside the canvas i have a 2 Panels
   is there any way to set the map to cover just 1 Panel .

2-is there any tutorial video that explain how to:
   - set a map
   - set my Prefab
   - updating my Prefab Location if i my device moved
   - set a markers
   - show the distance between my Prefab and Marker .

That will help me and others a Lot And Save Lot Of Time.
Thanks for you .

Re: Set Map On Part of Canvas

Hello.

1. Hierarchy / Create / Infinity Code / Online Maps / Map Wizard.
Select the type of map - 2D.
Select control - UI Image Control or UI RawImage Control.
Parent is your panel.

2.1. See answer 1.

2.2 - 2.3. Add Online Maps Location Service component.
Create Marker - ON.
Texture - The texture of your marker.
If you want to use prefab instead of texture, you need to use a custom marker system. Example:
http://infinity-code.com/atlas/online-m … ample.html

2.4. You can create markers using Online Maps Marker Manager component, or using Online Maps API.
http://infinity-code.com/doxygen/online … b7d40cef56

2.5. To calculate the distance between markers or locations, use OnlineMapsUtils.DistanceBetweenPoints.
http://infinity-code.com/doxygen/online … bc84a165f2
Example:
http://infinity-code.com/atlas/online-m … ample.html

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Set Map On Part of Canvas

Thanks for the fast replay
No.1 is done thanks

1-i can understand that if i attach the map to a panel then i cant view the map as 3D .

    cuase i am new on using Onlin maps  i need to ask some Q. to be clear for me
2- can i assign location by name "using geocoding" .. or should i have always API Key from google Maps.
   if the answer : should i have an API Key from google map
   then .. is that key free or its not ?

Again thanks for you for the fast Replay .

Re: Set Map On Part of Canvas

1. Tileset (3D map) is not UI element, and cannot be part of Canvas.
But Unity Engine is a very flexible tool, and with the use of multiple cameras, you can make it look like part of Canvas, although in fact it will be located outside UI.

2. For geocoding Online Maps supports: Google Gecoding API, Bing Maps Location API, Open Street Map Nominatim, AMap Search, QQ Search.
Which service to use is your choice.
To use Google API web services you need to have Google API key.
This key is paid, with a free quota of $ 200 per month.
This quota is enough for development and testing.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Set Map On Part of Canvas

"For geocoding Online Maps supports: Google Gecoding API, Bing Maps Location API, Open Street Map Nominatim, AMap Search, QQ Search."
1-google Gecoding api is Paid i know . what about the rest :  Bing Maps Location API, Open Street Map Nominatim, AMap Search,
    QQ Search
is it Paid ?

2- my App is not a web .its android or Ios  .. so can i use any Api Key "as Google map API Key"with android app ?

3- i want to start with creating a simple application that set my  device location  and the user set any other location as Remark and the purpose is to draw a line between my prefab and the remark "based on streets" so when my device move and change location .. its updated on the screen .. thats it ..
Any idea were to start and what to use for that ?

Re: Set Map On Part of Canvas

1. OSM Nomination - free, the rest - paid.

2. Projects and keys in Google Developer Console are platform-independent.
In the project, you should enable the services you need.
But keep in mind that Online Maps is not Google Maps SDK, and enable Map SDK services does not make sense.

3. Use Google Directions API (or HERE Routing API, or Open Route Service) to find the route between your location and the destination location.
Examples of finding a route for each service and displaying it on a map in the atlas of examples.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Set Map On Part of Canvas

Very Thanks for you :-)

Re: Set Map On Part of Canvas

OSM Nomination - free
so how can i use it while most of your scripts had (Public string ApiKey) use ;
i feel that some thing not clear for me about using keys and spacifing Providers and scripts usage .
can i set OSM Nomination as provider that is free and use scripts that asking for ApiKey ?
please i need to understand what happening here ?!!!!!!!

Re: Set Map On Part of Canvas

OSM Nominatim does not require a key.

OnlineMapsOSMNominatim.Search (string query, string acceptlanguage = "en", int limit = 0, bool addressdetails = true)    
http://infinity-code.com/doxygen/online … 667c3de960

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Set Map On Part of Canvas

if OSM does not require key  .. what about scripts that used key like (HereRoutingAPIExample,OpenRouteServiceExample)
it ask a key .!!!

Re: Set Map On Part of Canvas

HERE Routing API and Open Route Service require an API key.
But in post #8 you did not ask about these services.
You asked about OSM Nominatim.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Set Map On Part of Canvas

i am feel like i am losting :-(
beside there is no any examples about using OSM and routs
and i cant start with googl maps and get API key cuase like i understand  to get api key from google map i need to pay 200$ "and right now i cant".
i need some were to start and i cant find any point to start :-(
i cant find how to rout with OSM "examples missing .. and it well help me a lot and save my time"
i cant find how to make a search location by a name with OSM .
when I bought "online maps V3" i was Very excited .
i afraid for Getting disappointed . cause the library seem Cool and cant find and understand how to start .

Re: Set Map On Part of Canvas

and i cant start with googl maps and get API key cuase like i understand  to get api key from google map i need to pay 200$ "and right now i cant".

This key is paid, with a free quota of $ 200 per month.

Do you think you need to pay $ 200?
This means that for example you used Google services for $ 500, you substract $ 200, and you need to pay $ 300.
If you used the services for less than $ 200 you pay nothing.
I use keys in several projects that are used by thousands of people every month, and have not paid a single cent yet.

beside there is no any examples about using OSM and routs

Look carefully at the atlas of examples.
This contains examples for each service, except What3Words, an example of which you can find in the Examples (API Usage) folder of your project.
If we missed an example for something, you can request it, and I will make this example for you.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Set Map On Part of Canvas

i registered on Google map
i create a new project in google map and got an api key .
should i enable the key in all operation systems (Maps Sdk For Android ,Maps Sdk For ios,Places Api  ....) in google map page  in (Library)?


when i run the Buildings example its give me a Warning: Please enter Map / Key Manager / Google Maps

Re: Set Map On Part of Canvas

No, you only need to enable the services that you want to use, such as the Geocoding API, Places API, Directions API, etc.

In example scenes, the search uses Google Geocoding API, so if you want to use this search, you need to enter your key.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Set Map On Part of Canvas

should be the project name in google map the same as in unity .. cause when i add a OpenRouteServiceExample script to map object  and i add my Key to that script i got an error :

Exception: Could not find token at index 0
OnlineMapsJSON.NextTokenCore () (at Assets/Infinity Code/Online maps/Scripts/JSON/OnlineMapsJSON.cs:289)
OnlineMapsJSON.LookAhead () (at Assets/Infinity Code/Online maps/Scripts/JSON/OnlineMapsJSON.cs:178)
OnlineMapsJSON.ParseValueDirect () (at Assets/Infinity Code/Online maps/Scripts/JSON/OnlineMapsJSON.cs:628)
OnlineMapsJSON.ParseDirect (System.String json) (at Assets/Infinity Code/Online maps/Scripts/JSON/OnlineMapsJSON.cs:311)
OnlineMapsJSON.Deserialize[T] (System.String json) (at Assets/Infinity Code/Online maps/Scripts/JSON/OnlineMapsJSON.cs:37)
OnlineMapsOpenRouteService.GetDirectionResults (System.String response) (at Assets/Infinity Code/Online maps/Scripts/WebServices/OnlineMapsOpenRouteService.cs:53)
InfinityCode.OnlineMapsExamples.OpenRouteServiceExample.OnRequestComplete (System.String response) (at Assets/Infinity Code/Online maps/Examples (API usage)/OpenRouteServiceExample.cs:46)
OnlineMapsTextWebService.OnRequestComplete (OnlineMapsWWW www) (at Assets/Infinity Code/Online maps/Scripts/WebServices/Base/OnlineMapsTextWebService.cs:69)
OnlineMapsWWW.Finish () (at Assets/Infinity Code/Online maps/Scripts/Core/OnlineMapsWWW.cs:342)
OnlineMapsWWW+<WaitResponse>d__55.MoveNext () (at Assets/Infinity Code/Online maps/Scripts/Core/OnlineMapsWWW.cs:481)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Scripting/Coroutines.cs:17)

17 (edited by tamim.ali.zoabi 2019-09-12 19:25:28)

Re: Set Map On Part of Canvas

beside too many examples does'nt  requeir Api key like Buildings Example & Car Drive By Rout script And got a warning : Please enter Map / Key Manager / Google Maps
what is the reason of this warining ?

Re: Set Map On Part of Canvas

Maybe more one thing
I was reading the code of the atlas examples ..
In some scripts there was a public variables : application ID and application code .
That's not the apikey ..
What is it and from were can I got its value ?

Re: Set Map On Part of Canvas

should be the project name in google map the same as in unity .. cause when i add a OpenRouteServiceExample script to map object  and i add my Key to that script i got an error :

If you want to use Google web services, why do you use the example for Open Route Service?
Example for Google Directions API:
http://infinity-code.com/atlas/online-m … ample.html

beside too many examples does'nt  requeir Api key like Buildings Example & Car Drive By Rout script And got a warning : Please enter Map / Key Manager / Google Maps
what is the reason of this warining ?

Controls examples, Demo, and Building scenes use Google Geocoding API for the search bar.
Car Drive By Route uses Google Directions API to find a route.

In some scripts there was a public variables : application ID and application code .
That's not the apikey ..
What is it and from were can I got its value ?

HERE API uses app id and app code.
This is the same as api key, but HERE has split it into two values.
To get the app id and app code, create your application on here.com.
https://developer.here.com

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Set Map On Part of Canvas

I would like to thank and appreciate your help and tolerant about  my inquirers  ,I found the point were to start .
Now every thing is running ok..
thank you so much ,,,,,,