{"id":2576,"date":"2012-01-11T20:53:58","date_gmt":"2012-01-11T11:53:58","guid":{"rendered":"https:\/\/y2tech.net\/blog\/?p=2576"},"modified":"2012-06-26T16:03:35","modified_gmt":"2012-06-26T07:03:35","slug":"google_maps_on_openlayers","status":"publish","type":"post","link":"https:\/\/y2tech.net\/blog\/inet\/web\/google_maps_on_openlayers-2576\/","title":{"rendered":"OpenLayers\u3067Google Maps\u3092\u8868\u793a\u3057\u3066\u307f\u308b"},"content":{"rendered":"<h3>OpenLayers\u3092\u7528\u3044\u3066Google Maps\u306e\u5730\u56f3\u3092\u8868\u793a\u3057\u3066\u307f\u308b<\/h3>\r\n<br>\r\n<p><a href=\"http:\/\/openlayers.org\/\" title=\"OpenLayers\" target=\"_blank\">OpenLayers<\/a>\u306f\u6c4e\u7528\u7684\u306aJavascript\u30d9\u30fc\u30b9\u306e\u5730\u56f3\u8868\u793a\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3001<a href=\"http:\/\/www.opengeospatial.org\/\" title=\"OGC\" target=\"_blank\">Open Geospatial Consortium<\/a>\u306e <a href=\"http:\/\/www.opengeospatial.org\/standards\/wms\" title=\"Web Map Service\" target=\"_blank\">Web Map Service(WMS)<\/a> \u306a\u3069\u306e\u30d7\u30ed\u30c8\u30b3\u30eb\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u308b\uff0eWMS\u4ee5\u5916\u306b\u3082\u591a\u304f\u306e\u30d7\u30ed\u30c8\u30b3\u30eb\u306b\u5bfe\u5fdc\u3057\u3066\u304a\u308a\u3001\u30e1\u30b8\u30e3\u30fc\u306a\u3068\u3053\u308d\u3067\u306fGoogle Maps \u306e\u5730\u56f3\u3092\u76f4\u63a5\u8aad\u307f\u8fbc\u3093\u3067\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3042\u308b\uff0e<\/p>\r\n<br>\r\n<p>Google Maps\u306a\u3069\u306e\u30b3\u30de\u30fc\u30b7\u30e3\u30eb\u30d9\u30fc\u30b9\u306e\u30b5\u30fc\u30d3\u30b9\u3067\u306f Spherical Mercator \u6295\u5f71\u6cd5\u3092\u7528\u3044\u3066\u304a\u308a\u3001&#8221;EPSG:900913&#8243; \u3068\u3044\u3046X\u8ef8Y\u8ef8\u65b9\u5411\u3092\u8ddd\u96e2\u3067\u8868\u793a\u3057\u305f\u898f\u683c\u304c\u63a1\u7528\u3055\u308c\u3066\u304a\u308a\u3001OpenLayers\u81ea\u4f53\u306f &#8220;EPSG:4326&#8243;\u3000\u3068\u3044\u3046\u7def\u5ea6\u30fb\u7d4c\u5ea6\u30d9\u30fc\u30b9\u306e\u898f\u683c\u3092\u7528\u3044\u3066\u3044\u308b\uff0eOpenLayers\u306e\u30d9\u30fc\u30b9\u30de\u30c3\u30d7\u306bGoogle Maps\u306e\u5730\u56f3\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306b\u306f\u3001&#8221;EPSG:900913&#8243;\u3000\u3068 &#8220;EPSG:4326&#8243;\u306e\u9593\u3067\u6295\u5f71\u5909\u63db\u304c\u5fc5\u8981\u306b\u306a\u308b\u304c\u3001OpenLayers\u306b\u306f\u6295\u5f71\u5909\u63db\u3092\u884c\u3046\u30af\u30e9\u30b9\u3084\u30e1\u30bd\u30c3\u30c9\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u81ea\u5206\u3067\u9762\u5012\u306a\u5909\u63db\u51e6\u7406\u3092\u7528\u610f\u3059\u308b\u5fc5\u8981\u306f\u306a\u3044\uff0e<\/p>\r\n<br>\r\n<p><a href=\"http:\/\/docs.openlayers.org\/library\/spherical_mercator.html\" title=\"What is Spherical Mercator\" target=\"_blank\">Spherical Mercator<\/a>\u306b\u3064\u3044\u3066\u306fOpenLayer\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306b\u8a73\u3057\u3044\u89e3\u8aac\u304c\u3042\u308b\u306e\u3067\u3001\u4e00\u5ea6\u76ee\u3092\u901a\u3057\u3066\u304a\u304f\u3068\u826f\u3044\u3067\u3057\u3087\u3046\uff0e<\/p>\r\n<br>\r\n<p>OpenLayers\u306eGoogle Maps\u7528\u306e\u30ec\u30a4\u30e4\u30fc\u30af\u30e9\u30b9\u3092\u4f7f\u3046\u3068\u3001\u7c21\u6f54\u306aJavascript\u30b3\u30fc\u30c9\u3067Google Maps\u306e\u5730\u56f3\u30c7\u30fc\u30bf\u3092OpenLayers\u4e0a\u306b\u8868\u793a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\uff0e\r\n<br>\r\n \u307e\u3060OpenLayers\u306b\u3061\u3087\u3063\u3068\u89e6\u308c\u305f\u3060\u3051\u3067\u3001OpenLayers\u306b\u3069\u306e\u3088\u3046\u306a\u6a5f\u80fd\u304c\u3042\u308b\u306e\u304b\u3082\u826f\u304f\u5206\u304b\u3063\u3066\u3044\u306a\u3044\u72b6\u614b\u3060\u304c\u3001Web\u30a2\u30d7\u30ea\u3092\u958b\u767a\u3059\u308b\u969b\u306eJavascript\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3068\u3057\u3066\u91cd\u5b9d\u3057\u305d\u3046\u3060\uff0e\u307e\u3060\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u985e\u304c\u8ca7\u5f31\u3067\u3001\u7c21\u5358\u306a\u30af\u30e9\u30b9\u306e\u8aac\u660e\u3068\u5e7e\u3064\u304b\u306e\u7c21\u5358\u306a\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u304c\u516c\u958b\u3055\u308c\u3066\u3044\u308b\u3060\u3051\u3067\u3069\u306e\u3088\u3046\u306b\u4f7f\u3046\u306e\u304b\u3068\u3044\u3063\u305f\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u7684\u306a\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u304c\u6b86\u3069\u306a\u3044\u306e\u3067\u3001OpenLayers\u3092\u4f7f\u3044\u3053\u306a\u3059\u306e\u306b\u306f\u6642\u9593\u304c\u639b\u304b\u308a\u305d\u3046\u3060\uff0e\r\n<br>\r<\/p>\r\n<hr \/>\r\n<div style=\"width: 682px; margin: 0 auto; text-align: center;\">\r\n<h4> Google Maps \u3092OpenLayers\u306e\u80cc\u666f\u5730\u56f3\u3068\u3057\u3066\u53d6\u308a\u8fbc\u3093\u3060\u4f8b<\/h4>\r\n<br>\r\n<iframe loading=\"lazy\" src=\"\/blog\/wp-content\/uploads\/GISSample\/OpenLayersGoogle.html\" width=\"680\" height=\"500\" ><\/iframe>\r\n<\/div>\r\n<hr \/>\r\n<br>\r\n\u4e0a\u8a18\u306eHTML\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\uff1a\u3000<a href=\"https:\/\/y2tech.net\/blog\/wp-content\/uploads\/GISSample\/OpenLayersGoogle.html\" title=\"HTML\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\" target=\"_blank\">https:\/\/y2tech.net\/blog\/wp-content\/uploads\/GISSample\/OpenLayersGoogle.html<\/a>\r\n<br>\r\n[sourcecode language=&#8221;Javascript&#8221;]\r\n&lt;!DOCTYPE HTML PUBLIC &quot;-\/\/W3C\/\/DTD HTML 4.01\/\/EN&quot;\r\n\t\t&quot;http:\/\/www.w3.org\/TR\/html4\/strict.dtd&quot;&gt;\r\n&lt;html lang=&quot;ja&quot;&gt;\r\n&lt;head&gt;\r\n\t&lt;meta http-equiv=&quot;content-type&quot; content=&quot;text\/html; charset=utf-8&quot;&gt;\r\n\t&lt;title&gt;OpenLayers Test (Google Maps V3)&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;script src=&quot;http:\/\/openlayers.org\/api\/OpenLayers.js&quot;&gt;&lt;\/script&gt;\r\n&lt;script src=&quot;http:\/\/maps.google.co.jp\/maps\/api\/js?v=3.5&amp;sensor=false&amp;language=ja&quot;&gt;&lt;\/script&gt;\r\n&lt;script&gt;\r\nfunction init() {\r\n\r\n\tvar mapCenterLatLng = new OpenLayers.LonLat(139.553146, 35.336063); \/\/ Kamukura \r\n\t\r\n\tvar map = new OpenLayers.Map(&#8216;map_google&#8217;);\r\n\r\n\tmap.addControl( new OpenLayers.Control.LayerSwitcher() );\r\n\t\r\n\tvar gmap_terrain = new OpenLayers.Layer.Google(\r\n\t\t&quot;Google TERRAIN&quot;,\r\n\t\t{type: google.maps.MapTypeId.TERRAIN}\r\n\t);\r\n\tvar gmap = new OpenLayers.Layer.Google(\r\n\t\t&quot;Google ROADMAP&quot;, \/\/ the default\r\n\t\t{numZoomLevels: 20}\r\n\t);\r\n\tvar gmap_hybrid = new OpenLayers.Layer.Google(\r\n\t\t&quot;Google HYBRID&quot;,\r\n\t\t{type: google.maps.MapTypeId.HYBRID, numZoomLevels: 20}\r\n\t);\r\n\tvar gmap_satellite = new OpenLayers.Layer.Google(\r\n\t\t&quot;Google SATELLITE&quot;,\r\n\t\t{type: google.maps.MapTypeId.SATELLITE, numZoomLevels: 22}\r\n\t);\r\n\r\n\tmap.addLayers( [ gmap, gmap_terrain, gmap_hybrid, gmap_satellite] );\r\n\r\n\t\/\/ Google.v3 uses EPSG:900913 as projection, so we have to\r\n\t\/\/ transform our coordinates\r\n\t\r\n\tvar projection = new OpenLayers.Projection(&quot;EPSG:4326&quot;);\r\n\tvar mapCenterGoogle =  mapCenterLatLng.transform( projection, map.getProjectionObject() );\r\n\t\r\n\tmap.setCenter( mapCenterGoogle, 15 );\r\n}\r\n\r\n&lt;\/script&gt;\r\n&lt;style type=&quot;text\/css&quot;&gt;\r\n#map_google {\r\n  width:  100%;\r\n  height: 480px;\r\n  border: solid 1px #999;\r\n}\r\n\r\n&lt;\/style&gt;\r\n\r\n&lt;\/head&gt;\r\n\r\n&lt;body onload=&quot;init()&quot;&gt;\r\n\r\n&lt;div id=&quot;map_google&quot; &gt;&lt;\/div&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n\r\n[\/sourcecode]\r\n\r\n","protected":false},"excerpt":{"rendered":"OpenLayers\u306f\u6c4e\u7528\u7684\u306aJavascript\u30d9\u30fc\u30b9\u306e\u5730\u56f3\u8868\u793a\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3001Open Geospatial Consortium\u306e Web Map Service(WMS) \u306a\u3069\u306e\u30d7\u30ed\u30c8\u30b3\u30eb\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u308b\uff0eWMS\u4ee5\u5916\u306b\u3082\u591a\u304f\u306e\u30d7\u30ed\u30c8\u30b3\u30eb\u306b\u5bfe\u5fdc\u3057\u3066\u304a\u308a\u3001\u30e1\u30b8\u30e3\u30fc\u306a\u3068\u3053\u308d\u3067\u306fGoogle Maps \u306e\u5730\u56f3\u3092\u76f4\u63a5\u8aad\u307f\u8fbc\u3093\u3067\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3042\u308b\uff0e","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[561,11],"tags":[318,507,508],"class_list":["post-2576","post","type-post","status-publish","format-standard","hentry","category-webmap","category-web","tag-google-maps","tag-openlayers","tag-spherical-mercator"],"_links":{"self":[{"href":"https:\/\/y2tech.net\/blog\/wp-json\/wp\/v2\/posts\/2576","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/y2tech.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/y2tech.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/y2tech.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/y2tech.net\/blog\/wp-json\/wp\/v2\/comments?post=2576"}],"version-history":[{"count":0,"href":"https:\/\/y2tech.net\/blog\/wp-json\/wp\/v2\/posts\/2576\/revisions"}],"wp:attachment":[{"href":"https:\/\/y2tech.net\/blog\/wp-json\/wp\/v2\/media?parent=2576"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/y2tech.net\/blog\/wp-json\/wp\/v2\/categories?post=2576"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/y2tech.net\/blog\/wp-json\/wp\/v2\/tags?post=2576"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}