Select to view content in your preferred language

Custom Maps Layer and Basemaps

2321
11
08-11-2022 05:51 AM
roostorf
Emerging Contributor

Hey I have been working with ArcGIS Maps SDK for unity for the past few days and starting to get the hang of it except I have been having trouble customizing the map.  

Just for an example say I want to use this watercolor map
https://www.arcgis.com/home/item.html?id=21812b28afea4091bc57472297aa73d4

From my research on this page

https://developers.arcgis.com/unity/layers/

it seems like we use the id number 

21812b28afea4091bc57472297aa73d4,

and place the URL

https://www.arcgis.com/sharing/rest/content/items/21812b28afea4091bc57472297aa73d4/data

in the custom basemap source URL. 

This just makes the entire map white for me.  I have gotten a few URLs to work but most are either white or a copy of the satellite images.   I signed up and downloaded for ArcGIS pro, because I read I could make a .tpk or .tpkx file from there and use that as well but have not been able to figure that out either.
I would really like to figure out how to customize the colors and other aspects of my map but keep running into issues.  What is the best way for me to go about customizing my map for Unity SDK? 

Thanks!

0 Kudos
11 Replies
coryeicher
Frequent Contributor

Hi,

To use the watercolour map as a basemap in your Unity app, try doing this:

  1. Open this in your browser. This is a Web Map item https://www.arcgis.com/home/item.html?id=21812b28afea4091bc57472297aa73d4
  2. Click the link in the Description... or further down under Basemap This is a Tile Layer item https://www.arcgis.com/home/item.html?id=fdf540eef40344b79ead3c0c49be76a9
  3. At lower right under Url click View (or the "copy" button). This is a Vector Tile Service https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer
  4. Copy the Vector Tile Service url
  5. In Unity > ArcGIS Map > paste this into your Basemap url

Does this work for you?

re: customizing colors and other aspects.

  • The ArcGIS ecosystem supports customizing the styling of Vector Tile Services used as basemaps. The approach allows you to override styles without having to republish/host the actual data... note that this is not the case with image tiles...
  • ... I am not 100% sure the steps to do this, but there are links in the Description of this item (
  • https://www.arcgis.com/home/item.html?id=fdf540eef40344b79ead3c0c49be76a9)  worth following. Perhaps someone else in the community can assist. 
  • In the Unity SDK there are also the regular/operational/reference layers (whatever name you'd like to call them!). These are found in the Unity map builder ui under ArcGIS Maps SDK > Map Creator > Layers. You have full control over the styling of these data....
  • ... May be a bit of a learning curve depending on your starting point, but assuming you have feature data (points, lines, polygons), you can 3dify that data into multipatch geometries, then publish as web layers. That will get you ArcGIS 3D Object Scene Layers (aka Scene Layers) which you can add to Unity.... again you set up the styling in ArcGIS Pro when you publish. That styling "flows through" to unity.

Happy to help clarify either of the 2 main bits of this. Let me know how it goes.

-Cory

 

-Cory

CORY EICHER
www.eichcorp.com
cory@eichcorp.com
0 Kudos
SNauman
Occasional Contributor

Hi, unfortunately vector tile services aren't currently supported in the first release of the Unity SDK. However, this is a highly requested feature and it is on our roadmap.

Thanks!

0 Kudos
roostorf
Emerging Contributor

I tried the first method that you mentioned but the screen is just grey when I do that, I am not sure what the second part is saying I should try doing though.  I was able to add some cool satellite data from by using the URL https://earthlive.maptiles.arcgis.com/arcgis/rest/services/GOES/GOES31D/MapServer in layers tab which is neat but I don't know to what extent I can control the aesthetics that way.

Are  vector tile services a requirement for having custom maps besides satellite images?  I am just curious because on the page https://developers.arcgis.com/unity/layers/ it says "ArcGIS Maps SDK for Unity provides a number of preset basemaps." and I wanted to know what those basemaps were becuase if I can't use my own custom map, I would still prefer to see what their preset alternatives are until that feature is released.  Does anyone know exactly what that page is referring to? Also can I create a .tpkx or .tpk file in ARCGis pro and use a customized map generated that way?    When I use some urls like 
https://www.arcgis.com/sharing/rest/content/items/ea3befe305494bb5b2acd77e1b3135dc/data
https://www.arcgis.com/sharing/rest/content/items/c7d2b5c334364e8fb5b73b0f4d6a779b/data

those will load fine, but they are just satellite images and I would like it to look and feel to be more artistic and less realistic.  

Thanks again I really appreciate the help from both of responses!

0 Kudos
Nicholas-Furness
Esri Regular Contributor

Hi,

The requirement is that you use image tiled layers. Unfortunately (as @SNauman mentioned) we weren't able to get support for vector tile layers in for this first release, but it's one of our top priorities. Until we add vector tile support…

  • You can use a .tpkx or .tpk created in ArcGIS Pro.
  • You can publish an image tile service from ArcGIS Pro.
  • You could use a layer that's already published in ArcGIS Online. You can see a few examples published by Esri here (though because they're image tile layers, many of them are deprecated, so while you can dev/test with them, don't use them in production).
  • You could even use ArcGIS Pro to create an image tile layer of a map that just has a vector tile layer: I haven't tried this workflow, but I believe that in theory you could create a custom style in the Vector Tile Style Editor, create a Map in ArcGIS Pro using that custom style, and use ArcGIS Pro to export that to an image tile layer (I think ArcGIS Pro just refers to them as "tile layers") either as a local tile (.tpkx/tpk) or as a hosted service in ArcGIS Online. That would also probably be OK for dev & test if you're using our published basemaps as the source data but you'd need to talk to us about using that in production.

Those are all stopgap options until we add vector tile support to the Maps SDKs. At that point this will become much simpler.

0 Kudos
coryeicher
Frequent Contributor

Well, there's one vector tile basemap that works in Unity, but it's underwhelming for most purposes....

Blank White Vector Basemap

No joke, I am using this one for a blank-canvas look. Not helpful for your purposes...

Possibly useful, possibly undocumented constraint: the SDK requires a basemap (cannot leave empty). At least that's what I saw.

@SNauman @Nicholas-Furness Not sure if already on your roadmap, but for the vector tile limitation it could be helpful to update the doc with a note and log an error if not already doing so. This kind of failure is tough to diagnose from the outside.

-Cory

CORY EICHER
www.eichcorp.com
cory@eichcorp.com
0 Kudos
Nicholas-Furness
Esri Regular Contributor

@coryeicher wrote:

Well, there's one vector tile basemap that works in Unity, but it's underwhelming for most purposes....

Blank White Vector Basemap

No vector tile layer works in the ArcGIS Maps SDK for Unity. If it shows up as blank white tiles in Unity, that's just a happy coincidence 🙂

0 Kudos
coryeicher
Frequent Contributor
Haha yep.

Similar to "A broken clock is right twice a day"
CORY EICHER
www.eichcorp.com
cory@eichcorp.com
0 Kudos
Nicholas-Furness
Esri Regular Contributor

🫣 Could you share your code that does that please? I'd like to understand why that's happening. Could be helpful in documenting things.

0 Kudos
ChristofferLindellBolin
Occasional Contributor

Hi, I have been trying the last approach without any success. When I try to create a map tile package in ArcGIS pro, I get the error "Layer type is not supported: Map/World Imagery (for Export)".

This is my Drawing order:

ChristofferLindellBolin_0-1666016368169.png

I use this map https://tiledbasemaps.arcgis.com/arcgis/rest/services/World_Imagery/MapServer as the basemap

And the following style: https://kockums.maps.arcgis.com/home/item.html?id=8f4fde8063d04a1bb17824073d9a99dd

 

0 Kudos