Skip to content
This repository was archived by the owner on Oct 1, 2019. It is now read-only.

Commit 3f9849d

Browse files
committed
Upgrade and refactoring
+ changed return value of getContent method and content property - return single Element + add basic test + setup Travis CI pipeline + add Idea shared files to git + add source maps export + Update README + fix typos in doc comments
1 parent 007983a commit 3f9849d

31 files changed

+737
-365
lines changed

.babelrc

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"presets": [
3+
"es2015",
4+
"stage-0"
5+
],
6+
"plugins": [
7+
"transform-flow-strip-types",
8+
"transform-function-bind",
9+
"add-module-exports"
10+
]
11+
}

.editorconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ insert_final_newline = true
1919
[*.md]
2020
trim_trailing_whitespace = false
2121

22-
[*.json]
22+
[{*.json,*.yml,*.yaml,.babelrc}]
2323
indent_size=2

.gitignore

+98-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,99 @@
1-
.idea
2-
*.iml
1+
### Custom
2+
3+
4+
### Linux template
5+
*~
6+
7+
# temporary files which can be created if a process still has a handle open of a deleted file
8+
.fuse_hidden*
9+
10+
# KDE directory preferences
11+
.directory
12+
13+
# Linux trash folder which might appear on any partition or disk
14+
.Trash-*
15+
16+
### JetBrains template
17+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
18+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
19+
20+
# User-specific stuff:
21+
.idea/workspace.xml
22+
.idea/tasks.xml
23+
.idea/dictionaries
24+
.idea/vcs.xml
25+
.idea/jsLibraryMappings.xml
26+
27+
# Sensitive or high-churn files:
28+
.idea/dataSources.ids
29+
.idea/dataSources.xml
30+
.idea/dataSources.local.xml
31+
.idea/sqlDataSources.xml
32+
.idea/dynamic.xml
33+
.idea/uiDesigner.xml
34+
35+
# Gradle:
36+
.idea/gradle.xml
37+
.idea/libraries
38+
39+
# Mongo Explorer plugin:
40+
.idea/mongoSettings.xml
41+
42+
## File-based project format:
43+
*.iws
44+
45+
## Plugin-specific files:
46+
47+
# IntelliJ
48+
/out/
49+
50+
# mpeltonen/sbt-idea plugin
51+
.idea_modules/
52+
53+
# JIRA plugin
54+
atlassian-ide-plugin.xml
55+
56+
# Crashlytics plugin (for Android Studio and IntelliJ)
57+
com_crashlytics_export_strings.xml
58+
crashlytics.properties
59+
crashlytics-build.properties
60+
fabric.properties
61+
62+
### Node template
363
node_modules
4-
npm-debug.log
5-
/esdoc
64+
# Logs
65+
logs
66+
*.log
67+
npm-debug.log*
68+
69+
# Runtime data
70+
pids
71+
*.pid
72+
*.seed
73+
74+
# Directory for instrumented libs generated by jscoverage/JSCover
75+
lib-cov
76+
77+
# Coverage directory used by tools like istanbul
78+
coverage
79+
80+
# nyc test coverage
81+
.nyc_output
82+
83+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
84+
.grunt
85+
86+
# node-waf configuration
87+
.lock-wscript
88+
89+
# Compiled binary addons (http://nodejs.org/api/addons.html)
90+
build/Release
91+
92+
# Dependency directories
93+
jspm_packages
94+
95+
# Optional npm cache directory
96+
.npm
97+
98+
# Optional REPL history
99+
.node_repl_history

.idea/.name

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/compiler.xml

+23
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/copyright/profiles_settings.xml

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+20
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/watcherTasks.xml

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.travis.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
branches:
2+
only:
3+
- master
4+
language: node_js
5+
node_js:
6+
- 6
7+
cache:
8+
directories:
9+
- node_modules

README.md

+15-14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
[![Build Status](https://travis-ci.org/ghettovoice/ol3-popup-umd.svg?branch=master)](https://travis-ci.org/ghettovoice/ol3-popup-umd)
12
[![view on npm](http://img.shields.io/npm/v/ol3-popup-umd.svg)](https://www.npmjs.org/package/ol3-popup-umd)
23

34
# ol3-popup-umd
@@ -45,12 +46,12 @@ Click on the map to display a popup, click close to the edge of the map to see i
4546

4647
**Properties**
4748

48-
| Name | Type | Description |
49-
|------|------|-------------|
49+
| Name | Type | Description |
50+
|:------|:------|:-------------|
5051
| **id** | *number | string | undefined* | Set the overlay id. The overlay id can be used with the `ol.Map#getOverlayById` method. |
5152
| **offset** | *number[] | undefined* | Offsets in pixels used when positioning the overlay. The first element in the array is the horizontal offset. A positive value shifts the overlay right. The second element in the array is the vertical offset. A positive value shifts the overlay down. Default is `[0, 0]`. |
5253
| **position** | *ol.Coordinate | undefined* | The overlay position in map projection. |
53-
| **positioning** | *ol.OverlayPositioning | string | undefined* | Defines how the overlay is actually positioned with respect to its position property. Possible values are `bottom-left`, `bottom-center`, `bottom-right`, `center-left`, `center-center`, `center-right`, `top-left`, `top-center`, and `top-right`. Default is `top-left`. |
54+
| **positioning** | *ol.Overlay.Positioning | string | undefined* | Defines how the overlay is actually positioned with respect to its position property. Possible values are `bottom-left`, `bottom-center`, `bottom-right`, `center-left`, `center-center`, `center-right`, `top-left`, `top-center`, and `top-right`. Default is `top-left`. |
5455
| **stopEvent** | *boolean | undefined* | Whether event propagation to the map viewport should be stopped. Default is `true`. If true the overlay is placed in the same container as that of the controls (CSS class name `ol-overlaycontainer-stopevent`); if false it is placed in the container with CSS class name `ol-overlaycontainer`. |
5556
| **insertFirst** | *boolean | undefined* | Whether the overlay is inserted first in the overlay container, or appended. Default is `true`. If the overlay is placed in the same container as that of the controls (see the `stopEvent` option) you will probably set `insertFirst` to true so the overlay is displayed below the controls. |
5657
| **autoPan** | *boolean | undefined* | If set to `true` the map is panned when calling `setPosition`, so that the overlay is entirely visible in the current viewport. The default is `true`. |
@@ -75,16 +76,16 @@ Click on the map to display a popup, click close to the edge of the map to see i
7576

7677
**Params:**
7778

78-
| Name | Type | Description |
79-
|------|------|-------------|
79+
| Name | Type | Description |
80+
|:------|:------|:-------------|
8081
| **options** | *PopupOptions* | Popup options. |
8182

8283

8384
#### Members
8485

8586
set **content** : *HTMLCollection*
8687

87-
get **content** : *HTMLCollection*
88+
get **content** : *Element*
8889

8990

9091
#### Methods
@@ -97,8 +98,8 @@ get **content** : *HTMLCollection*
9798

9899
**Params:**
99100

100-
| Name | Type | Description |
101-
|------|------|-------------|
101+
| Name | Type | Description |
102+
|:------|:------|:-------------|
102103
| **content** | *Element | HTMLCollection | string* | Update popup inner content. |
103104

104105

@@ -110,15 +111,15 @@ get **content** : *HTMLCollection*
110111
---------
111112

112113

113-
**getContent**() : *HTMLCollection*
114+
**getContent**() : *Element*
114115

115116

116117

117118

118119

119120
**Returns:**
120121

121-
HTMLCollection - Inner content of popup.
122+
Element - Inner content of popup.
122123

123124

124125

@@ -132,8 +133,8 @@ HTMLCollection - Inner content of popup.
132133

133134
**Params:**
134135

135-
| Name | Type | Description |
136-
|------|------|-------------|
136+
| Name | Type | Description |
137+
|:------|:------|:-------------|
137138
| **map** | *ol.Map* | OpenLayers map object. |
138139

139140

@@ -163,8 +164,8 @@ Shows popup.
163164

164165
**Params:**
165166

166-
| Name | Type | Description |
167-
|------|------|-------------|
167+
| Name | Type | Description |
168+
|:------|:------|:-------------|
168169
| **coordinate** | *ol.Coordinate* | New popup position. |
169170
| **content** | *Element | HTMLCollection | string* | Replace inner content. |
170171

0 commit comments

Comments
 (0)