Widget:Google Street View: Unterschied zwischen den Versionen

Aus Hist. Verein Herne / Wanne-Eickel
KKeine Bearbeitungszusammenfassung
(änd)
Zeile 19: Zeile 19:
* '''lng''' - longitude of street view location
* '''lng''' - longitude of street view location
* '''height''' and '''width''' define view dimensions. Defaults: width=420; height=350
* '''height''' and '''width''' define view dimensions. Defaults: width=420; height=350
* '''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)
* '''heading''' - defines the horizontal angle between the camera's line of sight and the North direction, with 0 degrees pointing North.
* '''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). And for some reason, for static maps, this value must be negated, e.g. negative values look down and positive look up (don't ask me why the discrepancy).
* '''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). And for some reason, for static maps, this value must be negated, e.g. negative values look down and positive look up (don't ask me why the discrepancy).
* '''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. Works '''only for interactive''' street views - for static use '''fov''' parameter instead.
* '''fov''' - field of view, similar to zoom, but expressed in degrees for a field of view, default is 90 and maximum is 120. Works '''only for static''' street views - for interactive use '''zoom''' parameter instead.
* '''fov''' - field of view, similar to zoom, but expressed in degrees for a field of view, default is 90 and maximum is 120. Works '''only for static''' street views - for interactive use '''zoom''' parameter instead.
* '''static''' - if present, indicates that static image should be inserted instead of an interactive map. '''Note:''' some differences between static and interactive maps:
** use '''fov''' parameter instead of '''zoom'''
** make sure that you revert the value of '''pitch''' as negative values point down for static street views
** positioning does not necessarily match on the two - converting from interactive to static will give close enough position, but not perfect, manual correction might be required


 
</noinclude><includeonly><iframe
== Copy to your site ==
    src="//www.google.com/maps/embed/v1/streetview?key=AIzaSyC5R86btT-DazqkCZzCwBgG4D3zWny3Em8&location=<!--{$lat|default:'51.5379182'}-->,<!--{$lng|default:'7.2198481'}-->&heading=<!--{$heading|default:'0'}-->&pitch=<!--{$pitch|default:'0'}-->&fov=<!--{$fov|default:'90'}-->"  
To use this widget on your site, just install [https://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.
    width="<!--{$width|default:'600'}-->"  
</noinclude><includeonly><!--{if isset($static)}--><img src="http://maps.googleapis.com/maps/api/streetview?size=<!--{$width|escape:'urlpathinfo'|default:'420'}-->x<!--{$height|escape:'urlpathinfo'|default:350}-->&location=<!--{$lat|escape:'urlpathinfo'}-->,%20<!--{$lng|escape:'urlpathinfo'}-->&fov=<!--{$fov|escape:'urlpathinfo'|default:90}-->&heading=<!--{$yaw|escape:'urlpathinfo'|default:0}-->&pitch=<!--{$pitch|escape:'urlpathinfo'|default:0}-->&sensor=false" width="<!--{$width|escape:'html'|default:'420'}-->" height="<!--{$height|escape:'html'|default:350}-->"/><!--{else}--><!--{counter assign="panoDivID" name="panoDivID"}--><!--{if $panoDivID eq 1}--><script type="text/javascript" src="http://www.google.com/jsapi?key=<!--{$key|escape:'AIzaSyC5R86btT-DazqkCZzCwBgG4D3zWny3Em8'}-->"></script><!--{/if}-->
    height="<!--{$height|default:'450'}-->"  
<script type="text/javascript">
    style="border:0;"  
google.load("maps", "2.s");
    allowfullscreen=""  
google.setOnLoadCallback(function()
    loading="lazy"  
{
    referrerpolicy="no-referrer-when-downgrade">
var myPano = new GStreetviewPanorama(document.getElementById("pano<!--{$panoDivID|escape:'html'}-->"),
</iframe></includeonly>
{
latlng: new GLatLng('<!--{$lat|escape:'quotes'}-->', '<!--{$lng|escape:'quotes'}-->'),
pov: {
yaw:Number('<!--{$yaw|escape:'quotes'|default:0}-->'),
pitch:Number('<!--{$pitch|escape:'quotes'|default:0}-->'),
zoom:Number('<!--{$zoom|escape:'quotes'|default:0}-->')
}
});
});
</script>
<div id="pano<!--{$panoDivID|escape:'html'}-->" style="width: <!--{$width|escape:'html'|default:'420'}-->px; height: <!--{$height|escape:'html'|default:350}-->px"></div><!--{/if}--></includeonly>

Version vom 4. Dezember 2023, 19:26 Uhr

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.

{{#widget:Google Street View
|lat=40.758153
|lng=-73.985355
|yaw=370.64659986187695
|pitch=-20
|zoom=0
}}

Parameters

  • lat - lattitude of street view location
  • lng - longitude of street view location
  • height and width define view dimensions. Defaults: width=420; height=350
  • heading - defines the horizontal angle between the camera's line of sight and the North direction, with 0 degrees pointing North.
  • 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). And for some reason, for static maps, this value must be negated, e.g. negative values look down and positive look up (don't ask me why the discrepancy).
  • fov - field of view, similar to zoom, but expressed in degrees for a field of view, default is 90 and maximum is 120. Works only for static street views - for interactive use zoom parameter instead.