From 37ff3255068b9943784c78e1ca1c7b26155edb97 Mon Sep 17 00:00:00 2001 From: Shinichi Urabe Date: Wed, 9 Mar 2016 23:16:31 +0900 Subject: [PATCH 3/3] Only change the method of obtaining the value in the case of the new URL and the old URL (refs #3775) --- web/cmd/maps.google.co.jp.js | 56 +++++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/web/cmd/maps.google.co.jp.js b/web/cmd/maps.google.co.jp.js index 6711bd2..be6464d 100644 --- a/web/cmd/maps.google.co.jp.js +++ b/web/cmd/maps.google.co.jp.js @@ -11,38 +11,40 @@ function url2cmd(url, googlemapsUrl) { } function main(id, googlemapsUrl) { - if (id.match(/@/)) { - var cmd = id.match(/@(.+)z/); - var param = cmd[1].split(","); - var lon = param[0]; - var lat = param[1]; - var z = param[2]; + var param = { lon: 0, lat: 0, z: 15, t: '', q: '' }; + var result = id.match(/@([0-9\.]*),([0-9\.]*),([0-9]*z)/); - var html = '' - + ''; + if (result) { + param.lon = result[1]; + param.lat = result[2]; + param.z = result[3]; } else { - var cmd = id.split("&"); - var param = new Array(); - param["z"] = "15"; - param["ll"] = "0,0"; - for (i=0; i' - + 'この部分はインラインフレームを使用しています。' - + ''; + if (param[key] !== undefined) { + param[key] = value; + } else if ('ll' === key) { + param.lon = value.split(',')[0]; + param.lat = value.split(',')[1]; + } + } } + var html = ''; + document.write(html); } -- 2.7.1.287.g4943984