Google Groups Home
Help | Sign in
通过连接控制地图
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
minc  
View profile
(1 user)  More options May 9, 2:49 am
From: minc <mincg...@minc.com.cn>
Date: Thu, 8 May 2008 23:49:20 -0700 (PDT)
Local: Fri, May 9 2008 2:49 am
Subject: 通过连接控制地图
var p1 = new GLatLng(30.574 , 114.286);
var p2 = new GLatLng(18.273 , 109.474);
var m1 = new GMarker(p1);
var m2 = new GMarker(p2);
map.addOverlay(m1);
map.addOverlay(m2);
function changeMapLevel()
{
     var bounds = new GLatLngBounds();
     bounds.extend(p1);
     bounds.extend(p2);
     map.setCenter(bounds.getCenter(),
map.getBoundsZoomLevel(bounds));
}

document.getElementById("test").innerHTML = '<a
href=javascript:changeMapLevel()>' + "点击这里" + '</a>';
在下面的<div>标签中引用test,为什么不能执行changeMapLevel()函数?firefox提示changeMapLevel()未
被定义?
在前面加入GEvent.addListener(map, 'click', changeMapLevel);这行代码,点击地图是可以缩放地图
的。只是我现在想在地图的外面放置一个连接来控制地图的缩放,缺达不到效果。请教达人讲解!

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Potato  
View profile
 More options May 14, 5:12 am
From: Potato <quguang...@gmail.com>
Date: Wed, 14 May 2008 02:12:08 -0700 (PDT)
Local: Wed, May 14 2008 5:12 am
Subject: Re: 通过连接控制地图
Because your function 'changeMapLevel' is in the function initialize.
so it's can't be called.

On May 9, 6:49 am, minc <mincg...@minc.com.cn> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google