Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
ズームレベルによってのTLableの制御について
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
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
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
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
フェラーリ  
View profile   Translate to Translated (View Original)
 More options Jul 3, 1:07 am
From: フェラーリ <him...@kt.rim.or.jp>
Date: Thu, 2 Jul 2009 22:07:52 -0700 (PDT)
Local: Fri, Jul 3 2009 1:07 am
Subject: ズームレベルによってのTLableの制御について
ズームレベルによって、TLbelで設定された文字列の位置の書き換えを行ないたいと考えています。

ソースは下記の様に行っています。

var map;
function load(){
   var lat=35.68079483220707;
   var lng=139.76662874221802;
  var c_lat=35.68574469022577;
  var c_lng=139.75218772888184

  if (GBrowserIsCompatible()) {
    map = new GMap2(document.getElementById("map"));
    map.addControl(new GSmallMapControl());
    map.setCenter(new GLatLng(c_lat, c_lng), 14);

   var set_contents = '<div style= "white-space: nowrap;font-size:
70%;font-weight: bolder;color: black; background-olor:white;width:
auto;">'+ '東京駅' +' </div>';
    var latlng= new GLatLng(lat,lng);
    var label = new TLabel();

    label.id= 'tokyo_station' ;
l   label.anchorLatLng = latlng;
    label.anchorPoint = 'topCenter';
    label.markerOffset = new GSize(0,0);
    label.content = set_contents;
    label.percentOpacity = 80;
    map.addTLabel(label);

    GEvent.addListener(map, "zoomend", checkZoom);
 }

}

function checkZoom(oldZoom, newZoom) {
    var zoom = map.getZoom();
    var latlng;
    var content ;

    if (zoom == 15) {
      latlng=new GLatLng(35.67079483220707,139.76662874221802);
   var set_contents = '<div style= "white-space: nowrap;font-size:
70%;font-weight: bolder;color: black; background-olor:white;width:
auto;">'+ '東京駅' +' </div>';
    var latlng= new GLatLng(lat,lng);
    var label = new TLabel();

    label.id= 'tokyo_station' ;
    label.anchorLatLng = latlng;
    label.anchorPoint = 'topCenter';
    label.markerOffset = new GSize(0,0);
    label.content = set_contents;
    label.percentOpacity = 80;
    map.addTLabel(label);

    }

}

以上のようなイメージで実行したところ、
ズームアップ後の表示で、指定している場所と異なる部分に
ラベルが表示されてしまいます。

TLabelの使い方が間違っているかも知れませんが、
どなたかアドバイスをお願いいたします。


    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.
Masashi.K  
View profile   Translate to Translated (View Original)
 More options Jul 3, 1:30 am
From: "Masashi.K" <wf9a5...@gmail.com>
Date: Thu, 2 Jul 2009 22:30:39 -0700 (PDT)
Local: Fri, Jul 3 2009 1:30 am
Subject: Re: ズームレベルによってのTLableの制御について

>フェラーリさん

ズームレベルによって表示制御したいなら、GMarkerManager を使うと簡単ですよ。
ただ、TLabel.js は GMarkerManager に対応していないので、
同じような機能の LabeledMarker と組み合わせるのがオススメですよ。

LabeledMarker
http://gmaps-utility-library.googlecode.com/svn/trunk/labeledmarker/

On 7月3日, 午後2:07, フェラーリ <him...@kt.rim.or.jp> 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.
フェラーリ  
View profile   Translate to Translated (View Original)
 More options Jul 3, 5:04 am
From: フェラーリ <him...@kt.rim.or.jp>
Date: Fri, 3 Jul 2009 02:04:37 -0700 (PDT)
Local: Fri, Jul 3 2009 5:04 am
Subject: Re: ズームレベルによってのTLableの制御について
Masashi.K さん

On 7月3日, 午後2:30, "Masashi.K" <wf9a5...@gmail.com> wrote:

> >フェラーリさん

> ズームレベルによって表示制御したいなら、GMarkerManager を使うと簡単ですよ。
> ただ、TLabel.js は GMarkerManager に対応していないので、
> 同じような機能の LabeledMarker と組み合わせるのがオススメですよ。

そうなんです。TLabel.js が GMarkerManagerに対応していないようなので、
自分で制御を行うと考えました。

LabeledMarkerはオライリーの[google maps hacks]に記載いたので、一瞬考えたのですが、ラベルからウンドウを開くわけ
ではないでの、用途としては違うかなと
思っていました。

制御を考えるとありですね。

素朴な疑問ですが、画像をオリジナル画像で使用しないのであればマーカ機能と
 LabeledMarkerの違いはあるのでしょうか。

一つあるとするとマーカー機能では、影の画像が用意できるので見た目はよいと
思います。


    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.
Masashi.K  
View profile   Translate to Translated (View Original)
 More options Jul 3, 12:17 pm
From: "Masashi.K" <wf9a5...@gmail.com>
Date: Fri, 3 Jul 2009 09:17:48 -0700 (PDT)
Local: Fri, Jul 3 2009 12:17 pm
Subject: Re: ズームレベルによってのTLableの制御について

> 素朴な疑問ですが、画像をオリジナル画像で使用しないのであればマーカ機能と
>  LabeledMarkerの違いはあるのでしょうか。

> 一つあるとするとマーカー機能では、影の画像が用意できるので見た目はよいと
> 思います。

それもあるかとは思いますが、基本的にはマーカーを拡張しているだけなので、
アイコンを指定しないなら、通常のマーカーとほぼ同じですね。

On 7月3日, 午後6:04, フェラーリ <him...@kt.rim.or.jp> 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
©2009 Google