Skip to content

Commit

Permalink
Merge pull request #376 from GoogleWebComponents/2.0-preview
Browse files Browse the repository at this point in the history
2.0 preview
  • Loading branch information
e111077 authored Aug 2, 2017
2 parents 9ca485d + 54bb297 commit b423421
Show file tree
Hide file tree
Showing 15 changed files with 62 additions and 42 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ google-map
<google-map-marker latitude="37.78" longitude="-122.4" draggable="true"></google-map-marker>
</google-map>
```

Breaking changes:
* Markers added to `<google-map>` must now specify `slot="markers"` to be added correctly.
26 changes: 20 additions & 6 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,27 @@
"maps"
],
"dependencies": {
"polymer": "Polymer/polymer#^1.7.1",
"google-apis": "GoogleWebComponents/google-apis#^1.1.7",
"iron-resizable-behavior": "PolymerElements/iron-resizable-behavior#^1.0.5",
"iron-selector": "PolymerElements/iron-selector#^1.5.2"
"polymer": "Polymer/polymer#1.9 - 2",
"google-apis": "GoogleWebComponents/google-apis#^2.0.0",
"iron-resizable-behavior": "PolymerElements/iron-resizable-behavior#1 - 2",
"iron-selector": "PolymerElements/iron-selector#1 - 2"
},
"devDependencies": {
"web-component-tester": "*",
"iron-component-page": "PolymerElements/iron-component-page#^1.1.7"
"web-component-tester": "^6.0.0",
"iron-component-page": "PolymerElements/iron-component-page#^1 - 2"
},
"variants": {
"1.x": {
"dependencies": {
"polymer": "Polymer/polymer#^1.9.0",
"google-apis": "GoogleWebComponents/google-apis#^1.1.7",
"iron-resizable-behavior": "PolymerElements/iron-resizable-behavior#^1.0.5",
"iron-selector": "PolymerElements/iron-selector#^1.5.2"
},
"devDependencies": {
"web-component-tester": "^4.0.0",
"iron-component-page": "PolymerElements/iron-component-page#^1.1.7"
}
}
}
}
36 changes: 19 additions & 17 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<title>Google Map demo</title>
<script src="../../webcomponentsjs/webcomponents-lite.min.js"></script>
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="../google-map.html">
<link rel="import" href="../google-map-marker.html">
<link rel="import" href="../google-map-poly.html">
Expand All @@ -23,23 +23,25 @@
</head>
<body class="fullbleed">

<template is="dom-bind">
<google-map latitude="37.779" longitude="-122.3892" min-zoom="9" max-zoom="11"
language="en" api-key="[[apiKey]]">
<google-map-marker latitude="37.779" longitude="-122.3892" label="GG"
title="Go Giants!" draggable="true" drag-events>
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/4/49/San_Francisco_Giants_Cap_Insignia.svg/200px-San_Francisco_Giants_Cap_Insignia.svg.png" />
</google-map-marker>
<google-map-poly closed fill-color="red" fill-opacity=".25" stroke-weight="1">
<google-map-point latitude="37.779" longitude="-122.3892"></google-map-point>
<google-map-point latitude="37.804" longitude="-122.2711"></google-map-point>
<google-map-point latitude="37.386" longitude="-122.0837"></google-map-point>
</google-map-poly>
</google-map>
<dom-bind>
<template is="dom-bind">
<google-map latitude="37.779" longitude="-122.3892" min-zoom="9" max-zoom="11"
language="en" api-key="[[apiKey]]">
<google-map-marker slot="markers" latitude="37.779" longitude="-122.3892" label="GG"
title="Go Giants!" draggable="true" drag-events>
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/4/49/San_Francisco_Giants_Cap_Insignia.svg/200px-San_Francisco_Giants_Cap_Insignia.svg.png" />
</google-map-marker>
<google-map-poly closed fill-color="red" fill-opacity=".25" stroke-weight="1">
<google-map-point latitude="37.779" longitude="-122.3892"></google-map-point>
<google-map-point latitude="37.804" longitude="-122.2711"></google-map-point>
<google-map-point latitude="37.386" longitude="-122.0837"></google-map-point>
</google-map-poly>
</google-map>

<google-map-directions start-address="Oakland" end-address="Mountain View"
language="en" api-key="[[apiKey]]"></google-map-directions>
</template>
<google-map-directions start-address="Oakland" end-address="Mountain View"
language="en" api-key="[[apiKey]]"></google-map-directions>
</template>
</dom-bind>

<button id="controlsToggle" onclick="toggleControls()">Toggle controls</button>

Expand Down
2 changes: 1 addition & 1 deletion demo/kml.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<title>Google Map Poly demo</title>
<script src="../../webcomponentsjs/webcomponents-lite.min.js"></script>
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="../google-map.html">
<link rel="import" href="../google-map-poly.html">
<style>
Expand Down
2 changes: 1 addition & 1 deletion demo/polys.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<title>Google Map Poly demo</title>
<script src="../../webcomponentsjs/webcomponents-lite.min.js"></script>
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="../google-map.html">
<link rel="import" href="../google-map-poly.html">
<style>
Expand Down
2 changes: 1 addition & 1 deletion google-map-marker.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
}
</style>

<content></content>
<slot></slot>
</template>
<script>
(function() {
Expand Down
5 changes: 3 additions & 2 deletions google-map-poly.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
}
</style>

<content id="points" select="google-map-point"></content>
<slot id="points"></slot>
</template>
<script>
(function() {
Expand Down Expand Up @@ -487,7 +487,8 @@
this._building = true;
this.path.clear();
for (var i = 0, point; point = this._points[i]; ++i) {
this.path.push(point.getPosition());
if (point.tagName == 'google-map-point')
this.path.push(point.getPosition());
}
this._building = false;

Expand Down
4 changes: 2 additions & 2 deletions google-map.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@
selected-attribute="open"
activate-event="google-map-marker-open"
on-google-map-marker-close="_deselectMarker">
<content id="markers" select="google-map-marker"></content>
<slot id="markers" name="markers"></slot>
</iron-selector>

<content id="objects" select="*"></content>
<slot id="objects"></slot>
</template>
<script>
Polymer({
Expand Down
2 changes: 1 addition & 1 deletion test/google-map-basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<script src="../../webcomponentsjs/webcomponents.js"></script>
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../web-component-tester/browser.js"></script>
<link rel="import" href="../google-map.html">
</head>
Expand Down
2 changes: 1 addition & 1 deletion test/google-map-update-pos.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<script src="../../webcomponentsjs/webcomponents.js"></script>
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../web-component-tester/browser.js"></script>
<link rel="import" href="../google-map.html">
</head>
Expand Down
8 changes: 4 additions & 4 deletions test/marker-basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<script src="../../webcomponentsjs/webcomponents.js"></script>
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../web-component-tester/browser.js"></script>
<link rel="import" href="../google-map.html">
</head>
<body>

<google-map id="map1" latitude="37.77493" longitude="-122.41942">
<google-map-marker latitude="37.779" longitude="-122.3892"></google-map-marker>
<google-map-marker id="marker2" latitude="37.777" longitude="-122.38911" drag-events></google-map-marker>
<google-map-marker id="labeled-marker" label="GG" latitude="37.777" longitude="-122.38911" drag-events></google-map-marker>
<google-map-marker slot="markers" latitude="37.779" longitude="-122.3892"></google-map-marker>
<google-map-marker slot="markers" id="marker2" latitude="37.777" longitude="-122.38911" drag-events></google-map-marker>
<google-map-marker slot="markers" id="labeled-marker" label="GG" latitude="37.777" longitude="-122.38911" drag-events></google-map-marker>
</google-map>

<script>
Expand Down
6 changes: 3 additions & 3 deletions test/markers-add-remove.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<script src="../../webcomponentsjs/webcomponents.js"></script>
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../web-component-tester/browser.js"></script>
<link rel="import" href="../google-map.html">
</head>
<body>

<google-map id="map1" latitude="37.77493" longitude="-122.41942">
<google-map-marker latitude="37.779" longitude="-122.3892"></google-map-marker>
<google-map-marker latitude="37.777" longitude="-122.38911"></google-map-marker>
<google-map-marker slot="markers" latitude="37.779" longitude="-122.3892"></google-map-marker>
<google-map-marker slot="markers" latitude="37.777" longitude="-122.38911"></google-map-marker>
</google-map>

<script>
Expand Down
2 changes: 1 addition & 1 deletion test/origin-tests.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<script src="../../webcomponentsjs/webcomponents.js"></script>
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../web-component-tester/browser.js"></script>
<link rel="import" href="../google-map.html">
</head>
Expand Down
2 changes: 1 addition & 1 deletion test/poly-basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<script src="../../webcomponentsjs/webcomponents.js"></script>
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../web-component-tester/browser.js"></script>
<link rel="import" href="../google-map.html">
<link rel="import" href="../google-map-poly.html">
Expand Down
2 changes: 1 addition & 1 deletion test/poly-custom-properties.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<script src="../../webcomponentsjs/webcomponents.js"></script>
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../web-component-tester/browser.js"></script>
<link rel="import" href="../google-map.html">
<link rel="import" href="../google-map-poly.html">
Expand Down

0 comments on commit b423421

Please sign in to comment.