サーバーから画像をjson形式で取得します。
image=iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAIAA
Google マーカーの場合、次の方法で画像を割り当てる必要があります。
var myImage = "../Content/image.jpeg";
var markerOptions = {
position: bound,
map: map,
icon: myImage
};
json画像データをGoogleマップが受け入れる画像に変換するにはどうすればよいですか?
私はこれを試しました:
var image = document.createElement('img');
image.src = "data:image/png;base64" + base64JsonData;
しかし、これは実行時にエラーになります。
これは、フラッド防止のために以前はここに貼り付けなかった完全な json です...:
image=iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAIAAABvFaqvAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAYHSURBVDhPJVVbbBxnFf7n8s/OfWavM2t7187GGzuNnditQykx0FiltgQPVCapxUOaQkCCIsRLXpDyCogKeENVJZCoaKUSaEoSMJVoH9wqiWvIxVHcUstkY8d41/buzu7s3G8cq6PRP6Pzn/Od7zvnnzOEl0QIoSgKMIVtx5Q4IY4jiiBQAneI4oNN5AaIppDd++2rv6y3dllV+enPf4EShGg+QVRjv53PZUkSPFHMUNgPHD7FEghRYIN4x0GBj6IARfHBurNdu3WrXns4Wjm8+3grbLcQRXVa+xCr5bI9y6ZRHPiuK/ICj1OQxDVNGiWJ52FJRkC2/r9/L314+Y9vrN25069rSibdzalcHNGyjLqGkk4DX8txRUEkkiSAwF6nK4oCioEp0InB6dqbb929dXN1+QZybU2SRIZhSdKNQ+1I9aO7t3/35lvqxCSisdXpCRktQgSRBC6QBCzkQyEwss33r1177Te/xoGHbEvFVBqTXJIQjh3aVkxTvN73sLXf8vy3F/9OVKooxSIS9xyHRCTlGB0QFbguCL67spKR5YVvvaDyfArFCibZMEg6LSHy8wzVz7PJ3q4axZV0+tw3X+g8WIXKoCQQGBBCQCViRCAsSbW1tRs3Pvps/dPR0dHx48d4FlNxiFFEha5IxSqNxCTQGVzEzJGCdmJw6JWXzqP9PdBOkAQZh4GYVp2eaXba199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