Forum Discussion
Custom Shape Maps Unexpected Error
- 9 years ago
Ok, I think I might know the potential cause of your issue. When you pulled the file off of GitHub, my guess is that you did not save the actual json file. Instead, you probably right-clicked in the ReadMe and did a Save As on the link to the blob. Is that correct?
GitHub shows a preview of TopoJson, GeoJson, etc. blobs on their own page. Unless you download the entire repo, you need to click through the link and save the Raw json instead of the blob preview.
I literally just typed in the stuff in my sample above, set the Country column's data category to Country/Region, and tried to load world-countries.json into the map. Here's the error details:
Feedback Type:
Frown (Error)
Timestamp:
2016-10-24T14:19:49.8800528Z
Local Time:
2016-10-24T10:19:49.8800528-04:00
Product Version:
2.39.4526.362 (PBIDesktop) (x64)
Release:
September 2016
IE Version:
11.321.14393.0
OS Version:
Microsoft Windows NT 10.0.14393.0 (x64 en-US)
CLR Version:
4.6.2. or later [Release Number = 394802]
Workbook Package Info:
1* - en-US, fastCombine: Disabled.
Peak Working Set:
386 MB
Private Memory:
260 MB
Peak Virtual Memory:
33.9 GB
JS Error Message:
Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.
Error Message:
An error occurred while rendering the report.
Stack Trace:
Microsoft.Mashup.Host.Document.JavaScriptException: An error occurred while rendering the report.
Error: Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.
at Error (native)
at saveSliceToDefinition (ms-pbi://pbi.microsoft.com/minerva/scripts/exploreui.js:9328:77)
at Object.saveChangedSliceToDefinition [as save] (ms-pbi://pbi.microsoft.com/minerva/scripts/exploreui.js:9354:25)
at ms-pbi://pbi.microsoft.com/minerva/scripts/exploreui.js:8590:113
at UndoRedoService.register (ms-pbi://pbi.microsoft.com/minerva/scripts/explore.js:6265:159)
at PropertyPaneController.save (ms-pbi://pbi.microsoft.com/minerva/scripts/exploreui.js:8589:93)
at fn (eval at <anonymous> (ms-pbi://pbi.microsoft.com/minerva/scripts/angular.js:1:0), <anonymous>:4:382)
at PropertyCardController.destination.(anonymous function) [as cardChanged] (ms-pbi://pbi.microsoft.com/minerva/scripts/angular.js:9739:22)
at PropertyCardController.sliceChanged (ms-pbi://pbi.microsoft.com/minerva/scripts/exploreui.js:8515:127)
at fn (eval at <anonymous> (ms-pbi://pbi.microsoft.com/minerva/scripts/angular.js:1:0), <anonymous>:4:323)
Invocation Stack Trace:
at Microsoft.Mashup.Host.Document.ExceptionExtensions.GetCurrentInvocationStackTrace()
at Microsoft.Mashup.Client.ClientShared.StackTraceInfo..ctor(String exceptionStackTrace, String invocationStackTrace)
at Microsoft.Mashup.Client.ClientShared.FeedbackErrorInfo..ctor(String message, Nullable`1 errorCode, String requestId, Exception exception)
at Microsoft.Mashup.Client.ClientShared.UnexpectedExceptionHandler.<>c__DisplayClass1.<HandleException>b__0()
at Microsoft.Mashup.Host.Document.SynchronizationContextExtensions.<>c__DisplayClass3.<SendAndMarshalExceptions>b__0(Object null)
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at Microsoft.Mashup.Client.ClientShared.WindowManager.ShowDialog[T](T form, IWin32Window owner)
at Microsoft.PowerBI.Client.Program.<>c__DisplayClassb.<Main>b__0()
at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)
at Microsoft.PowerBI.Client.Program.Main(String[] args)
User ID:
73a57705-1f23-4e51-9f3a-7208da732c7f
Session ID:
b9b3d5f6-84b2-47d9-b322-55db2026d8e6
Telemetry Enabled:
True
Model Default Mode:
Import
Snapshot Trace Logs:
C:\Users\khorseman\AppData\Local\Microsoft\Power BI Desktop\FrownSnapShot2069757971.zip
Performance Trace Logs:
C:\Users\khorseman\AppData\Local\Microsoft\Power BI Desktop\PerformanceTraces.zip
Enabled Preview Features:
PBI_shapeMapVisualEnabled
PBI_forecastEnabled
Disabled Preview Features:
PBI_RedShift
PBI_Impala
PBI_Snowflake
PBI_allowBiDiCrossFilterInDirectQuery
PBI_esriEnabled
PBI_mobileReportAuthoringEnabled
Disabled DirectQuery Options:
DirectQuery_Unrestricted
Recent Actions:
AddEmptyVisualContainer, AddFieldInRole, VisualContainerPersistProperties, AddFieldInRole, AddVisualContainer, AddFieldToVisual, VisualConversion
Formulas:
section Section1;
shared Table1 = let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("NY3LCsIwFER/Re66G/NodakFoUI3iquQxaUJGAi3kqSgfr154PKcYWaUgge5ZM3unjDZCB3sQXcKpoT+k0kyKaq4BKTFZvMXpy2mgN5hdoehqtsWY+Nj5fHpqKDsW+WKL6QSNzwH/DpfLlnl2b7dsmYWXLTBEQlNWeByaJ2JTH1gXILWPw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Country = _t, Amount = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Country", type text}, {"Amount", Int64.Type}})
in
#"Changed Type";
Active Section Contract:
{"id":0,"name":"ReportSection","displayName":"Page 1","ordinal":0,"visualContainers":[{"x":10,"y":20,"z":1,"width":280,"height":280,"config":"{\"layouts\":[{\"id\":0,\"position\":{\"x\":10,\"y\":20,\"width\":280,\"height\":280,\"z\":1}}],\"singleVisual\":{\"visualType\":\"shapeMap\",\"projections\":{\"Category\":[{\"queryRef\":\"Table1.Country\"}],\"Value\":[{\"queryRef\":\"Sum(Table1.Amount)\"}]},\"prototypeQuery\":{\"Version\":2,\"From\":[{\"Name\":\"t\",\"Entity\":\"Table1\"}],\"Select\":[{\"Column\":{\"Expression\":{\"SourceRef\":{\"Source\":\"t\"}},\"Property\":\"Country\"},\"Name\":\"Table1.Country\"},{\"Aggregation\":{\"Expression\":{\"Column\":{\"Expression\":{\"SourceRef\":{\"Source\":\"t\"}},\"Property\":\"Amount\"}},\"Function\":0},\"Name\":\"Sum(Table1.Amount)\"}]},\"objects\":{\"shape\":[{\"properties\":{\"map\":{\"geoJson\":{\"type\":{\"expr\":{\"Literal\":{\"Value\":\"'shared'\"}}},\"name\":{\"expr\":{\"Literal\":{\"Value\":\"'usa.states.topo'\"}}},\"content\":{\"expr\":{\"ResourcePackageItem\":{\"PackageName\":\"ShapeMap\",\"PackageType\":2,\"ItemName\":\"usa.states.topo\"}}}}},\"projectionEnum\":{\"expr\":{\"Literal\":{\"Value\":\"'albersUsa'\"}}}}}],\"dataPoint\":[{\"properties\":{\"fillRule\":{\"linearGradient2\":{\"max\":{\"color\":{\"expr\":{\"Literal\":{\"Value\":\"'#01B8AA'\"}}}},\"min\":{\"color\":{\"expr\":{\"Literal\":{\"Value\":\"'#ccf1ee'\"}}}}}}}}]}},\"name\":\"VisualContainer\"}"},{"x":441.875759416768,"y":107.2053462940462,"z":2,"width":300,"height":300,"config":"{\"layouts\":[{\"id\":0,\"position\":{\"x\":441.875759416768,\"y\":107.2053462940462,\"width\":300,\"height\":300,\"z\":2}}],\"singleVisual\":{\"visualType\":\"table\",\"projections\":{\"Values\":[{\"queryRef\":\"Table1.Country\"},{\"queryRef\":\"Sum(Table1.Amount)\"}]},\"prototypeQuery\":{\"Version\":2,\"From\":[{\"Name\":\"t\",\"Entity\":\"Table1\"}],\"Select\":[{\"Column\":{\"Expression\":{\"SourceRef\":{\"Source\":\"t\"}},\"Property\":\"Country\"},\"Name\":\"Table1.Country\"},{\"Aggregation\":{\"Expression\":{\"Column\":{\"Expression\":{\"SourceRef\":{\"Source\":\"t\"}},\"Property\":\"Amount\"}},\"Function\":0},\"Name\":\"Sum(Table1.Amount)\"}]}},\"name\":\"VisualContainer1\"}"}],"displayOption":1,"width":1280,"height":720,"config":"{}"}
deldersveld I'm encountering the same issue as Anonymous (btw I can also open your pbix file and it works fine)
However when I try to use any of your TopoJSON files I get that Error => Here's what I'm doing...
- Anonymous9 years agoNot applicable
Yep, Sean could just as well have been taking screenshots off my computer. Identical to what I'm doing.
- deldersveld9 years agoResident Rockstar
Ok, I think I might know the potential cause of your issue. When you pulled the file off of GitHub, my guess is that you did not save the actual json file. Instead, you probably right-clicked in the ReadMe and did a Save As on the link to the blob. Is that correct?
GitHub shows a preview of TopoJson, GeoJson, etc. blobs on their own page. Unless you download the entire repo, you need to click through the link and save the Raw json instead of the blob preview.
- Anonymous9 years agoNot applicable
deldersveld yep that was it. Thanks. I assumed that a URL that ended in a file name with a file extension was a link to the actual file with that name and extension. Silly me. Apparently github is different from the entire rest of the internet.