-
Notifications
You must be signed in to change notification settings - Fork 3
/
google-map-point.js
53 lines (46 loc) · 1.38 KB
/
google-map-point.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import { Polymer } from '../../@polymer/polymer/lib/legacy/polymer-fn.js';
/* Copyright (c) 2015 Google Inc. All rights reserved. */
/*
The `google-map-point` element represents a point on a map. It's used as a child of other
google-map-* elements.
<b>Example</b>—points defining a semi-translucent blue triangle:
<google-map latitude="37.77493" longitude="-122.41942">
<google-map-poly closed fill-color="blue" fill-opacity=".5">
<google-map-point latitude="36.77493" longitude="-121.41942"></google-map-point>
<google-map-point latitude="38.77493" longitude="-122.41942"></google-map-point>
<google-map-point latitude="36.77493" longitude="-123.41942"></google-map-point>
</google-map-poly>
</google-map>
*/
Polymer({
is: 'google-map-point',
hostAttributes: { hidden: true },
properties: {
/**
* The point's longitude coordinate.
*/
longitude: {
type: Number,
value: null,
notify: true,
reflectToAttribute: true,
},
/**
* The point's latitude coordinate.
*/
latitude: {
type: Number,
value: null,
notify: true,
reflectToAttribute: true,
},
},
/**
* Returns the point as a Google Maps LatLng object.
*
* @return {google.maps.LatLng} The LatLng object.
*/
getPosition() {
return new google.maps.LatLng(this.latitude, this.longitude);
},
});