エントリー

GoogleMapsAPI V2 -001

とりあえずソース

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>MAP TEST</title>
<script src="http://maps.google.com/maps?file=api&v=2&key=所得キー" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
function load () {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(34.97440093, 139.0924426), 16);
}
}
//]]>
</script>
</head>
<body onload="load()" onunload="GUnload()">
<div id="map" style="width: 800px; height: 600px"></div>
</body>
</html>

実際の表示はこちら (o>▽<)つ http://izuito.net/_test/maptest.htm

単純に地図を表示させるだけです。
V1との違いといえば…
・所得キー前の「v=1」を「v=2」へ
・var map = new 「GMap」を「GMap2」へ
・「map.centerAndZoom(new GPoint(X,Y), Z)」を
 「map.setCenter(new GLatLng(Y,X), 17-Z)」へ
 ※X,Yが逆。Zが大きくなる程、拡大表示へ(V1は0で最大)

とりあえず気付いた点は、こんなところでしょうか?
といっても、片手間で確認した程度 & 勉強不足なのですが… orz

ページ移動

トラックバック

  • トラックバックはまだありません。

トラックバックURL

https://izuito.net/_cgi/freo/trackback/54

コメント

  • コメントはまだありません。

コメント登録

  • コメントを入力してください。
登録フォーム
名前
メールアドレス
URL
投稿キー(スパム対策に、投稿キー を半角で入力してください。)
コメント
閲覧制限

ユーティリティ

- 1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 - - - -

過去ログ

ノート

  • ノートは登録されていません。

新着エントリー

javascript 再勉強中
2024/03/08 10:56
ベータガンダムは伊達じゃない
2024/02/21 11:07
残り約50ページ
2024/01/29 13:07
スマホのカメラ機能
2023/12/19 11:59
ガラケー卒業
2023/11/27 18:57

新着コメント

Re:スマホのカメラ機能
2024/01/13 from dshata
Re:スマホのカメラ機能
2024/01/12 from とくめい
Re:アクアビーズアート(2)
2021/10/10 from はやとまる
Re:旗印、自作してみた。
2021/02/18 from goopee
Re:初のスキルLV.10武将 の続き 2
2014/09/24 from DSHata(管理人)