嘛,我發現它在網絡上:如何改變lat和長PARAMS
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Google Maps con Polymer</title>
<link rel="stylesheet" href="css/google-map.css">
<script src="components/platform/platform.js"></script>
<!-- 2.- La sentención (link rel="import") nos permite importar Web Components personalizdos
en este caso estamos importando el de google-map -->
<link rel="import" href="components/google-map/google-map.html">
</head>
<body>
<google-map lat="37.790" long="122.390"></google-map>
</body>
</html>
這表明我的舊金山,EEUU。但是,當我改變參數(拉特和長):
<google-map lat="-30.761" long="-57.990"></google-map>
它顯示我相同的地圖。
我改變相同PARAMS在該文件中的谷歌組件:「搜索引擎map.html」
這是一段代碼:
<script>
Polymer('google-map', {
/**
* A Maps API key. To obtain an API key, see developers.google.com/maps/documentation/javascript/tutorial#api_key.
*
* @property apiKey
* @type string
*/
apiKey: null,
/**
* A latitude to center the map on.
*
* @attribute latitude
* @type number
* @default 37.77493
*/
latitude: -30.761111,
/**
* A longitude to center the map on.
*
* @attribute longitude
* @type number
* @default -122.41942
*/
longitude: -57.990111,
和它的功能爲我。
所以我需要解決這種情況:獲得我想要的地圖,但只有我在應用程序的主索引中調用的參數。不能觸摸或重寫組件代碼。
謝謝,它真的功能! – user3780282
很高興能幫到你!您可能想將此標記爲已接受的答案。 –