|
|
行1: |
行1: |
− | ==googlemap貼り付けたい場所に==
| + | [[Google/Googlemap/API]] |
− | <div id="map-canvas"></div>
| + | |
− | | + | |
− | ==jsコード==
| + | |
− | body閉じるタグの直前に。
| + | |
− | (34.804618851, 135.345302589)の所には緯度経度を入力。
| + | |
− | <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
| + | |
− | <style>
| + | |
− | #map-canvas {
| + | |
− | height: 400px;
| + | |
− | margin: 0px;
| + | |
− | padding: 0px
| + | |
− | }
| + | |
− | </style>
| + | |
− | <script type="text/javascript">
| + | |
− | google.maps.event.addDomListener(window, 'load', function() {
| + | |
− | var map = document.getElementById("map-canvas");
| + | |
− | var options = {
| + | |
− | zoom: 17,
| + | |
− | center: new google.maps.LatLng(34.804618851, 135.345302589),
| + | |
− | mapTypeId: google.maps.MapTypeId.ROADMAP
| + | |
− | };
| + | |
− | var map = new google.maps.Map(map, options);
| + | |
− | var marker = new google.maps.Marker({
| + | |
− | position: new google.maps.LatLng(34.804618851, 135.345302589),
| + | |
− | map: map,
| + | |
− | title: "pin表示"
| + | |
− | });
| + | |
− | });
| + | |
− | </script>
| + | |