JS Web SDK で Azure Maps を使用しようとしています。https://docs.microsoft.com/en-us/azure/azure-maps/how-to-use-map-controlの指示に従って、サブスクリプション キーを追加するだけでスローされますエラー。
すべてのオプションを削除しようとしましたが、資格情報の入力を求められたので、認証されていることがわかりました。DOM にない識別子を入力すると、ID が見つからないというエラーが表示されます。正しい ID を入力すると、ドラッグ可能な白い背景が表示され、下部に Microsoft のロゴが表示されます。デバッガーからの呼び出しは、this.map.setStyle(this.styleBuilder.build()),
追加のスタイル オプションを指定して、中央、ズーム、および言語を削除しようとしたためです。も使ってみwindow.onload
ました。全体として、問題は解決しません。
必要なのは、スクリプトをロードして次のスニペットを挿入することだけです。
var map = new atlas.Map(<div id>, {
center: [-122.33, 47.6],
zoom: 12,
language: 'en-US',
authOptions: {
authType: 'subscriptionKey',
subscriptionKey: '<Your Azure Maps Key>'
}
});
私がしたこと。
そのスニペットだけがこのエラーを生成しました:
Uncaught (in promise) TypeError: Cannot read property 'origin' of
undefined
at Object.at [as getReferrer] (atlas.min.js:3066)
at new r (atlas.min.js:3066)
at n._updateStyle (atlas.min.js:3066)
at n.setStyle (atlas.min.js:3066)
at e._rebuildStyle (atlas.min.js:3391)
at atlas.min.js:3391
at @ atlas.min.js:3066
r @ atlas.min.js:3066
n._updateStyle @ atlas.min.js:3066
n.setStyle @ atlas.min.js:3066
e._rebuildStyle @ atlas.min.js:3391
(anonymous) @ atlas.min.js:3391
Promise.then (async)
e._setStyleComponents @ atlas.min.js:3391
(anonymous) @ atlas.min.js:3391
Promise.then (async)
e @ atlas.min.js:3391
(anonymous) @ myScript.js:787
そして、これはかなり印刷されたエラーメッセージです:
Uncaught (in promise) TypeError: Cannot read property 'origin' of undefined
at Object.at [as getReferrer] (atlas.min.js:formatted:25499)
at new r (atlas.min.js:formatted:47165)
at n._updateStyle (atlas.min.js:formatted:52481)
at n.setStyle (atlas.min.js:formatted:52475)
at e._rebuildStyle (atlas.min.js:formatted:60131)
at atlas.min.js:formatted:60219
at @ atlas.min.js:formatted:25499
r @ atlas.min.js:formatted:47165
n._updateStyle @ atlas.min.js:formatted:52481
n.setStyle @ atlas.min.js:formatted:52475
e._rebuildStyle @ atlas.min.js:formatted:60131
(anonymous) @ atlas.min.js:formatted:60219
Promise.then (async)
e._setStyleComponents @ atlas.min.js:formatted:60172
(anonymous) @ atlas.min.js:formatted:59678
Promise.then (async)
e @ atlas.min.js:formatted:59673
(anonymous) @ myScript.js:formatted:787
EDIT:ヘッダーのスクリプトをコメントアウトして始めました。すべての JQuery スクリプト タグを削除すると、マップが機能しました。(その後、JQuery の最新バージョンに取り組んでいることを確認しました)。しかし、もちろん私のページは機能しません。また、動作中にorigin
、エラーをスローしたプロパティを確認しました。コードはでしself.location.origin
た。だから今、私は非互換性を持っています。self
window
誰かが何らかの支援を提供できれば、それは大歓迎です。