在嵌入式谷歌地图上使用外部JavaScript

时间:2012-02-16 06:56:27

标签: javascript google-maps

我使用嵌入式谷歌地图如下。我想添加删除lat-long标记的功能,这是一个谷歌地图实验室功能。我想使用的javascript文件是:latlngmarker.10.js

我正在尝试添加的HTML是:

<html>
<head>
<style>
body{margin:0px;}
</style>
<title></title>
</head>
<body>
<div style="overflow:auto;width:1000px;height:1000px" id="map_div">
<iframe width="1000" height="1000" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com.au/maps?hl=en&amp;ie=UTF8&amp;ll=-28.08928,152.84630&amp;spn=0.016831,0.033045&amp;t=k&amp;z=19&amp;output=embed&amp;s=AARTsJpnOA3ioEtcI9rx_v7gyZqlolGTYw"></iframe>
</div>
</body>
</html>

我已经尝试添加标签,但我真的卡住了。一些指示将非常感激。

谢谢你, 卡斯

修改 我也可以使用以下内容,但是再次 - 我如何引用drop lat-long标记?:

<!DOCTYPE html>
<html>
  <head>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <style type="text/css">
      html { height: 100% }
      body { height: 100%; margin: 0; padding: 0 }
      #map_canvas { height: 100% }
    </style>
    <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false">
    </script>
    <script type="text/javascript">
      function initialize() {
        var myOptions = {
zoomControl: true,
    zoomControlOptions: {
      style: google.maps.ZoomControlStyle.SMALL
    },
          center: new google.maps.LatLng(-20.2622, 148.7040),
          zoom: 20,
          mapTypeId: google.maps.MapTypeId.SATELLITE
        };
        var map = new google.maps.Map(document.getElementById("map_canvas"),
            myOptions);
      }
    </script>
  </head>
  <body onload="initialize()">
    <div id="map_canvas" style="width:100%; height:100%"></div>
  </body>
</html>

0 个答案:

没有答案