SYNCERのロゴ
アイキャッチ画像

[廃止] Attribution

Attributionは、マーカーに紐付いた場所を保存した時に、マイプレイスの中で場所の情報として表示される補足情報をまとめたオブジェクトです。

バージョン3.28で、この機能は廃止されました。

プロパティ

プロパティ名説明
iosDeepLinkId

string

iOSアプリのdeep link。

source

string

ソースの名前。アプリ名、ウェブサイト名など。

webUrl

string

ウェブサイトのURL。

デモ

このオブジェクトは廃止されたため、正常に動作しません。

var attribution = {
//	iosDeepLinkId: "hoge://" ,
	source: "SYNCER" ,
	webUrl: "https://syncer.jp/" ,
} ;

var opts = {
	map: map ,
	position: map.getCenter() ,
	location: {
		location: new google.maps.LatLng( 35, 139 ) ,
		query: "SYNCERビル" ,
	} ,
	attribution: attribution ,
} ;

var marker = new google.maps.Marker( opts ) ;

サンプルコード

<!DOCTYPE html>
<html>
<head>
	<style>
#map-canvas {
	width: 600px ;
	height: 600px ;
}
	</style>
</head>
<body>
	<div id="map-canvas"></div>

	<script src="//maps.googleapis.com/maps/api/js?key={APIキー}"></script>
	<script>
// Map
var mapDiv = document.getElementById( "map-canvas" ) ;

var mapOpts = {
	center: new google.maps.LatLng( 35, 139 ) ,
	zoom: 11 ,
} ;

var map = new google.maps.Map( mapDiv, mapOpts ) ;

// Marker
var attribution = {
//	iosDeepLinkId: "hoge://" ,
	source: "SYNCER" ,
	webUrl: "https://syncer.jp/" ,
} ;

var markerOpts = {
	map: map ,
	position: map.getCenter() ,
	location: {
		location: new google.maps.LatLng( 35, 139 ) ,
		query: "SYNCERビル" ,
	} ,
	attribution: attribution ,
} ;

var marker = new google.maps.Marker( markerOpts ) ;

// InfoWindow
var infoWindow = new google.maps.InfoWindow( {
	"content": "" ,
} ) ;

infoWindow.open( map, marker ) ;
	</script>
</body>
</html>

デモページを開く

  • Twitterでシェア
  • Facebookでシェア
  • Google+でシェア
  • はてなブックマークでシェア
  • pocketに保存
  • LINEでシェア
更新履歴
2017年1月1日 (日)
コンテンツを公開しました。