-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathpx-map-layer-geojson.html
74 lines (60 loc) · 2.66 KB
/
px-map-layer-geojson.html
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!--
Copyright (c) 2018, General Electric
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!--
Relative paths assume component is being run from inside an app or another component, where dependencies are flat
siblings. When this component is run from its own repo (e.g. tests, examples), we assume the server is started with
'gulp serve' (or similar server setup) to enable correct finding of bower dependencies for local runs.
-->
<link rel="import" href="../polymer/polymer.html"/>
<!-- Load required PxMapBehaviors -->
<link rel="import" href="px-map-behavior-layer-geojson.html">
<!--
This subcomponent draws GeoJSON features as vectors on the map. Use it to draw
common shapes like points, lines, polygons, circles, and rectangles (see the
`data` attribute documentation for more info on what can be drawn).
The layer only accepts valid GeoJSON formatted data — sending in invalid data
that does not conform to the [GeoJSON spec](http://geojson.org/geojson-spec.html)
will cause the layer to fail and not draw.
### Usage
<px-map>
<px-map-layer-geojson data='{"type": "FeatureCollection", "features": [{"type": "Feature","properties": {},"geometry": {"type": "Point","coordinates": [0.11278152465820314,52.23526420307733]}}]}'>
</px-map-layer-geojson>
</px-map>
#### Styling features
There are two ways to style the features that the layer draws. To style all the
features for the entire layer, use the `featureStyle` attribute. To style each
feature individually, add a `style` object to the feature's `properties`.
See the API documentation below for instructions on what style options are
available.
#### Displaying feature properties
Enable the `showFeatureProperties` attribute to show a popup with feature properties
when the user taps on a feature. This is a useful way to show relevant information
about each feature.
@element px-map-layer-geojson
@blurb Draws GeoJSON features as vectors on a map
@homepage index.html
@demo index.html
-->
<dom-module id="px-map-layer-geojson">
<template>
<style>
:host { display: none }
</style>
</template>
</dom-module>
<script>
Polymer({
is: 'px-map-layer-geojson',
behaviors: [PxMapBehavior.GeoJSONLayer]
});
</script>