「微件:Google Street View」:修訂間差異

出自Eason Chan Music Wiki 迅音樂:陳奕迅音樂維基
跳至導覽 跳至搜尋
無編輯摘要
無編輯摘要
 
第1行: 第1行:
__NOTOC__
<noinclude>__NOTOC__
This widget allows you to add '''[http://maps.google.com/help/maps/streetview/ Google Street View]''' widget to your wiki page.
This widget allows you to add '''[http://maps.google.com/help/maps/streetview/ Google Street View]''' widget to your wiki page.


Created by [[mediawikiwiki:User:Sergey Chernyshev|Sergey Chernyshev]]
Created by [http://www.mediawikiwidgets.org/User:Sergey_Chernyshev Sergey Chernyshev]


To insert this widget, use the following code:
== Using this widget ==
For information on how to use this widget, see [http://www.mediawikiwidgets.org/Google_Street_View widget description page on MediaWikiWidgets.org].


<nowiki>{{#widget:</nowiki>{{PAGENAME}}<nowiki>
== Copy to your site ==
|key=ABQIAAAAq_i4aTseMGLic8bgu1NQHRRuMGSDM4hOrlKevQrS9qsdJ_NOCxRsXLLNmhAg5xMn9btyuqHxCavIxw
To use this widget on your site, just install [http://www.mediawiki.org/wiki/Extension:Widgets MediaWiki Widgets extension] and copy [{{fullurl:{{FULLPAGENAME}}|action=edit}} full source code] of this page to your wiki as '''{{FULLPAGENAME}}''' article.
|lat=40.758153
</noinclude><includeonly><!--{counter assign="panoDivID" name="panoDivID"}--><script type="text/javascript" src="http://www.google.com/jsapi?key=<!--{$key|escape:'urlpathinfo'}-->"></script>
|lng=-73.985355
<script type="text/javascript">
|yaw=370.64659986187695
google.load("maps", "2.x");
|pitch=-20
google.setOnLoadCallback(function()
|zoom=0
{
}}</nowiki>
var myPano = new GStreetviewPanorama(document.getElementById("pano<!--{$panoDivID|escape:'html'}-->"),
 
{
== Parameters ==
latlng: new GLatLng('<!--{$lat|escape:'quotes'}-->', '<!--{$lng|escape:'quotes'}-->'),
* '''key''' - Google developer key for your site (you must [http://code.google.com/apis/ajaxsearch/signup.html get your own] or it will not work).
pov: {
* '''lat''' - lattitude of street view location
yaw:Number('<!--{$yaw|escape:'quotes'|default:0}-->'),
* '''lng''' - longitude of street view location
pitch:Number('<!--{$pitch|escape:'quotes'|default:0}-->'),
* '''height''' and '''width''' define view dimensions, 420x350 is default
zoom:Number('<!--{$zoom|escape:'quotes'|default:0}-->')
* '''yaw''' - defines the rotation angle around the camera locus in degrees relative from true north. Yaw angles are measured clockwise (90 degrees is true east)
}
* '''pitch''' - defines the angle variance "up" or "down" from the camera's initial default pitch, which is often (but not always) flat horizontal. (For example, an image taken on a hill will likely exhibit a default pitch that is not horizontal.) Pitch angles are measured with negative values looking up (to -90 degrees straight up and orthogonal to the default pitch) and positive values looking down (to +90 degrees straight down and orthogonal to the default pitch)
});
* '''zoom''' - defines the zoom level of this view (effectively proscribing the "field of view") with 0 being fully zoomed-out. Different Street View locations may provide higher or lower zoom levels.
});
 
</script>
== Bookmarklet ==
<div id="pano<!--{$panoDivID|escape:'html'}-->" style="width: <!--{$width|escape:'html'|default:'420'}-->px; height: <!--{$height|escape:'html'|default:350}-->px"></div>
Sometimes it's hard to get all the parameters you need for a Street View to display - coming up with longitude and latitude, direction (yaw), pitch, correct zoom levels and so on might take too much time.
</includeonly>
 
To help with this problem, we created a bookmarklet that you can use on Google Maps site to grab Street View widget code for current location with just one click.
 
Drag this bookmarklet {{#widget:Bookmarklets/Google Maps|key=ABQIAAAAq_i4aTseMGLic8bgu1NQHRRuMGSDM4hOrlKevQrS9qsdJ_NOCxRsXLLNmhAg5xMn9btyuqHxCavIxw|text=Maps Widget Code}} to your links toolbar and just click it when you want to post a location on the map to your wiki.
 
You can insert this bookmarklet (with your Google Maps developer key preset) into your wiki using [[Widget:Bookmarklets/Google Maps|Google Maps bookmarklet widget]].
 
== Related widgets ==
* [[Google Maps]]
 
== Sample result ==
{{#widget:{{PAGENAME}}
|key=ABQIAAAA-9Dn7_xZhVLK5JLvo57mJxTzKSzksHzMbl4WW_q7cz_uAkR9JhTC56hMlDju6wvFSPhB35n9uxHgkQ
|lat=40.758153
|lng=-73.985355
|yaw=370.64659986187695
|pitch=-20
|zoom=0
}}
 
{{widget
|author=Sergey Chernyshev
|provider=Google Street View
|providerurl=http://maps.google.com/help/maps/streetview/
|addedon=June 10, 2008
}}

於 2010年10月13日 (三) 19:17 的最新修訂

This widget allows you to add Google Street View widget to your wiki page.

Created by Sergey Chernyshev

Using this widget

For information on how to use this widget, see widget description page on MediaWikiWidgets.org.

Copy to your site

To use this widget on your site, just install MediaWiki Widgets extension and copy full source code of this page to your wiki as 微件:Google Street View article.