Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Datazen
Helper I
Helper I

Need to control the color of a Reference Layer in Azure Maps

I have an Azure Map in my Power BI Desktop file and I want to color code the US states according to my companies regions. To do this I am using a 'reference layer' which gets its JSON from a file I have provided. I decided to first experiment with a layer that just defines the state of Colorado in the USA. and I sourced the JSON polygon coordinates from available GeoJSON repositiories on Github.

 

It works fine in highlighting Colorado- which is shaded blue. But I did not choose the color blue. And I can find no place where the color blue is set in the Azure Map menus. And my GEOJSON code for Colorado has no attribute relating to color. So what determines that Colorado is showing blue? In my main JSON theme file (provided by my company) there are plenty of places where colors are specified, but I can find no tags that would relate to Azure Maps. 

 

Can anyone tell me what JSON elements would result in making Colorado blue? Thanks. - John

1 ACCEPTED SOLUTION
Benton
Frequent Visitor

Hey John,

 

I believe the Azure Maps Visual defaults to blue if you don't specify the fill color and stroke color in your GeoJSON.  Here is an example of the properties you need to set: "fillColor":"rgb(255,0,0)","stroke-width":"3","stroke": "#555555"

 

{"type":"FeatureCollection","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:OGC:1.3:CRS84"}},"features":[{"type":"Feature","geometry":{"type":"MultiPolygon","coordinates":[[[[-109.06018824156149,38.2755269021159],[-109.06011924196429,38.500016502497424],[-109.05982744220965,38.715593402879044],[-109.05396514174998,38.88200710313349],[-109.05262064224317,39.0026547033935],[-109.05155284181106,39.11057730355151],[-109.0514859415767,39.1157440035784],[-109.05115844187422,39.20654090367074],[-109.0508346423324,39.36655700396887],[-109.05122234173552,39.49780640421703],[-109.05128564152223,39.66917170443636],[-109.0509483420983,40.22277850532463],[-109.05092704214451,40.306172505494594],[-109.05089184166,40.33561900551647],[-109.05109304182638,40.453789105741805],[-109.05074714193188,40.47968610577637],[-109.04802384164736,40.580624805879914],[-109.04867434228936,40.65527130599219],[-109.04882294160412,40.74695890616865],[-109.04870834172632,40.77153660623534],[-109.04866994234106,40.79247680622116],[-109.04845554232985,40.826081906306904],[-109.04850834170918,40.83208410628812],[-109.04883134175037,40.848021706291966],[-109.04904504197397,40.89390270638447],[-109.04923944189363,40.906239106419704],[-109.05002774230401,41.000690106540425],[-107.91539863830805,41.00082560654845],[-107.31780283693898,41.00290880655762],[-107.13536603616888,41.003036106572985],[-107.0315128353155,41.00340030657416],[-106.8577733354056,41.00266310652872],[-106.58079233435211,41.001932106539506],[-106.45795953350623,41.002093806529636],[-106.36905073361407,41.00048830653992],[-106.35259543371387,41.00001900653346],[-106.32127293316984,40.99931110658408],[-106.19056463274606,40.997544306580835],[-106.08787983285714,40.99737270654582],[-105.6669235311978,40.99701510656456],[-105.47893673107413,40.99775410652407],[-105.27686032998538,40.998172106530006],[-104.94337562886194,40.99823990658217],[-104.85520072920303,40.998069506564455],[-104.60670022772199,41.001518806549086],[-104.05321422671591,41.00167980655304],[-103.574066924773,41.00173000655268],[-102.62055362196823,41.00213590653214],[-102.05157792016385,41.00236010655477],[-102.05175662022724,40.00306250496861],[-102.04980972037049,39.57395790432998],[-102.0497641200899,39.56817010432884],[-102.0470479200894,39.13379070357641],[-102.04651401987333,39.04539640344389],[-102.04535492006535,38.695238702835],[-102.0445683201658,38.26881910210092],[-102.0445110202269,38.26248340211102],[-102.04199031968399,37.73854070117468],[-102.04158531962678,37.64428210101002],[-102.04158612002568,37.389190500537616],[-102.04212741966477,36.993127599873375],[-102.26271962056339,36.994832399854616],[-102.69763582173181,36.995121799831324],[-102.74190302220441,36.99762389986227],[-102.75858962212133,36.99991599985216],[-102.97972592270779,36.99873229983627],[-103.00224842339472,37.00020649987968],[-103.08617282300095,36.99835359986901],[-104.00785692603249,36.99690969986928],[-104.48328662741552,36.9937684998168],[-105.14314393009349,36.99513119986862],[-105.22061293004657,36.99500979985009],[-105.64129503084608,36.99573649988681],[-105.71920443166522,36.99583659984417],[-106.00663473225607,36.995343199831886],[-106.02391393280149,36.99521009983976],[-106.07403233235343,36.99495049984717],[-106.14662383243805,36.99473639988445],[-106.16385053274314,36.99446349987959],[-106.47708553373768,36.99375589984149],[-106.86979633510369,36.9924260998427],[-106.87729233510036,37.00013909989491],[-106.98551333532167,37.0001300998673],[-107.1968898364726,37.0000060998408],[-107.42091533641411,37.00000009985985],[-107.47793683709357,37.000100699846215],[-108.37964433952153,37.00004299987109],[-109.04520184166563,36.998973499892614],[-109.04549644236734,37.24041320032925],[-109.04577754228862,37.323846900478465],[-109.04577384212794,37.33079870042539],[-109.0456560415528,37.356347600492576],[-109.04524164152441,37.400998400607186],[-109.04360274164021,37.47605600069581],[-109.0427144416704,37.50965330075352],[-109.04216284194824,37.533375600830624],[-109.04190434184295,37.61214890094852],[-109.04199504204253,37.879213301441226],[-109.04258314211143,38.153026701902675],[-109.04283684161983,38.16627020191974],[-109.06018824156149,38.2755269021159]]]]},"properties":{"tag":"Test","name":"Test","fillColor":"rgb(255,0,0)","stroke-width":"3","stroke": "#555555","metadata":"{\"type\":\"markup-builder\",\"subType\":\"territory\",\"territoryIdColumnName\":\"ISO2\",\"territoryIds\":[\"US-CO\"],\"centroidWkts\":null,\"territoryIdHistory\":[],\"holesRemoved\":true,\"layerId\":\"fc0bd68e-54af-4144-90e1-9b79c9465aca\",\"countryCode\":null,\"labelPoint\":{\"_x\":-11749870.93235,\"_y\":4725447.163705}}","azureKey":null,"col1":"Test"}}]}

 

Results in:

Benton_0-1693595685275.png

If you really want to get fancy, you can use Territory Visual by EasyTerritory to build your regions & territories and then bind them to metrics in your data model to build interactive heat maps.

 

Benton_1-1693595816612.png

 

Hope this helps!
Benton (from EasyTerritory)

 

View solution in original post

2 REPLIES 2
Datazen
Helper I
Helper I

Thanks very much Benton! I will dig into the code you provided and see if I can get it to work. I'll also check out the Easy Territory visuals. I appreciate your efforts here. -John

Benton
Frequent Visitor

Hey John,

 

I believe the Azure Maps Visual defaults to blue if you don't specify the fill color and stroke color in your GeoJSON.  Here is an example of the properties you need to set: "fillColor":"rgb(255,0,0)","stroke-width":"3","stroke": "#555555"

 

{"type":"FeatureCollection","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:OGC:1.3:CRS84"}},"features":[{"type":"Feature","geometry":{"type":"MultiPolygon","coordinates":[[[[-109.06018824156149,38.2755269021159],[-109.06011924196429,38.500016502497424],[-109.05982744220965,38.715593402879044],[-109.05396514174998,38.88200710313349],[-109.05262064224317,39.0026547033935],[-109.05155284181106,39.11057730355151],[-109.0514859415767,39.1157440035784],[-109.05115844187422,39.20654090367074],[-109.0508346423324,39.36655700396887],[-109.05122234173552,39.49780640421703],[-109.05128564152223,39.66917170443636],[-109.0509483420983,40.22277850532463],[-109.05092704214451,40.306172505494594],[-109.05089184166,40.33561900551647],[-109.05109304182638,40.453789105741805],[-109.05074714193188,40.47968610577637],[-109.04802384164736,40.580624805879914],[-109.04867434228936,40.65527130599219],[-109.04882294160412,40.74695890616865],[-109.04870834172632,40.77153660623534],[-109.04866994234106,40.79247680622116],[-109.04845554232985,40.826081906306904],[-109.04850834170918,40.83208410628812],[-109.04883134175037,40.848021706291966],[-109.04904504197397,40.89390270638447],[-109.04923944189363,40.906239106419704],[-109.05002774230401,41.000690106540425],[-107.91539863830805,41.00082560654845],[-107.31780283693898,41.00290880655762],[-107.13536603616888,41.003036106572985],[-107.0315128353155,41.00340030657416],[-106.8577733354056,41.00266310652872],[-106.58079233435211,41.001932106539506],[-106.45795953350623,41.002093806529636],[-106.36905073361407,41.00048830653992],[-106.35259543371387,41.00001900653346],[-106.32127293316984,40.99931110658408],[-106.19056463274606,40.997544306580835],[-106.08787983285714,40.99737270654582],[-105.6669235311978,40.99701510656456],[-105.47893673107413,40.99775410652407],[-105.27686032998538,40.998172106530006],[-104.94337562886194,40.99823990658217],[-104.85520072920303,40.998069506564455],[-104.60670022772199,41.001518806549086],[-104.05321422671591,41.00167980655304],[-103.574066924773,41.00173000655268],[-102.62055362196823,41.00213590653214],[-102.05157792016385,41.00236010655477],[-102.05175662022724,40.00306250496861],[-102.04980972037049,39.57395790432998],[-102.0497641200899,39.56817010432884],[-102.0470479200894,39.13379070357641],[-102.04651401987333,39.04539640344389],[-102.04535492006535,38.695238702835],[-102.0445683201658,38.26881910210092],[-102.0445110202269,38.26248340211102],[-102.04199031968399,37.73854070117468],[-102.04158531962678,37.64428210101002],[-102.04158612002568,37.389190500537616],[-102.04212741966477,36.993127599873375],[-102.26271962056339,36.994832399854616],[-102.69763582173181,36.995121799831324],[-102.74190302220441,36.99762389986227],[-102.75858962212133,36.99991599985216],[-102.97972592270779,36.99873229983627],[-103.00224842339472,37.00020649987968],[-103.08617282300095,36.99835359986901],[-104.00785692603249,36.99690969986928],[-104.48328662741552,36.9937684998168],[-105.14314393009349,36.99513119986862],[-105.22061293004657,36.99500979985009],[-105.64129503084608,36.99573649988681],[-105.71920443166522,36.99583659984417],[-106.00663473225607,36.995343199831886],[-106.02391393280149,36.99521009983976],[-106.07403233235343,36.99495049984717],[-106.14662383243805,36.99473639988445],[-106.16385053274314,36.99446349987959],[-106.47708553373768,36.99375589984149],[-106.86979633510369,36.9924260998427],[-106.87729233510036,37.00013909989491],[-106.98551333532167,37.0001300998673],[-107.1968898364726,37.0000060998408],[-107.42091533641411,37.00000009985985],[-107.47793683709357,37.000100699846215],[-108.37964433952153,37.00004299987109],[-109.04520184166563,36.998973499892614],[-109.04549644236734,37.24041320032925],[-109.04577754228862,37.323846900478465],[-109.04577384212794,37.33079870042539],[-109.0456560415528,37.356347600492576],[-109.04524164152441,37.400998400607186],[-109.04360274164021,37.47605600069581],[-109.0427144416704,37.50965330075352],[-109.04216284194824,37.533375600830624],[-109.04190434184295,37.61214890094852],[-109.04199504204253,37.879213301441226],[-109.04258314211143,38.153026701902675],[-109.04283684161983,38.16627020191974],[-109.06018824156149,38.2755269021159]]]]},"properties":{"tag":"Test","name":"Test","fillColor":"rgb(255,0,0)","stroke-width":"3","stroke": "#555555","metadata":"{\"type\":\"markup-builder\",\"subType\":\"territory\",\"territoryIdColumnName\":\"ISO2\",\"territoryIds\":[\"US-CO\"],\"centroidWkts\":null,\"territoryIdHistory\":[],\"holesRemoved\":true,\"layerId\":\"fc0bd68e-54af-4144-90e1-9b79c9465aca\",\"countryCode\":null,\"labelPoint\":{\"_x\":-11749870.93235,\"_y\":4725447.163705}}","azureKey":null,"col1":"Test"}}]}

 

Results in:

Benton_0-1693595685275.png

If you really want to get fancy, you can use Territory Visual by EasyTerritory to build your regions & territories and then bind them to metrics in your data model to build interactive heat maps.

 

Benton_1-1693595816612.png

 

Hope this helps!
Benton (from EasyTerritory)

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.