Skip to content

Commit

Permalink
Release v2.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jonataswalker committed Feb 24, 2017
1 parent 4824162 commit 9153d87
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 48 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# OpenLayers 3 Custom Context Menu
# OpenLayers Custom Context Menu

<p align="center">
<a href="https://travis-ci.org/jonataswalker/ol3-contextmenu">
Expand All @@ -21,12 +21,12 @@
</a>
</p>

A `contextmenu` extension for [OpenLayers 3](http://openlayers.org/). **Requires** OpenLayers **v3.11.0** or higher.
A `contextmenu` extension for [OpenLayers](http://openlayers.org/). **Requires** OpenLayers **v3.11.0** or higher.

![contextmenu anim](https://raw.githubusercontent.com/jonataswalker/ol3-contextmenu/screenshot/images/anim.gif)

## Demo
You can see [here a demo](http://rawgit.com/jonataswalker/ol3-contextmenu/master/examples/contextmenu.html) or [JSFiddle](http://jsfiddle.net/jonataswalker/ooxs1w5d/).
You can see [here a demo](http://rawgit.com/jonataswalker/ol3-contextmenu/master/examples/contextmenu.html) or [JSFiddle](https://jsfiddle.net/jonataswalker/ooxs1w5d/).

## How to use it?
##### CDN Hosted - [jsDelivr](http://www.jsdelivr.com/projects/openlayers.contextmenu)
Expand Down
51 changes: 19 additions & 32 deletions build/ol3-contextmenu-debug.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*!
* ol3-contextmenu - v2.4.1
* Custom Context Menu for Openlayers 3
* ol3-contextmenu - v2.5.0
* Custom Context Menu for Openlayers
* https://github.com/jonataswalker/ol3-contextmenu
* Built: Fri Jan 27 2017 07:46:19 GMT-0200 (BRST)
* Built: Fri Feb 24 2017 15:11:20 GMT-0300 (BRT)
*/

(function (global, factory) {
Expand Down Expand Up @@ -76,37 +76,24 @@ var defaultItems = [
text: 'Zoom In',
classname: [CLASSNAME.zoomIn, CLASSNAME.icon].join(' '),
callback: function (obj, map) {
var view = map.getView(),
pan = ol.animation.pan({
duration: 1000,
source: view.getCenter()
}),
zoom = ol.animation.zoom({
duration: 1000,
resolution: view.getResolution()
});

map.beforeRender(pan, zoom);
view.setCenter(obj.coordinate);
view.setZoom(+view.getZoom() + 1);
var view = map.getView();
view.animate({
zoom: +view.getZoom() + 1,
duration: 700,
center: obj.coordinate
});
}
},
{
text: 'Zoom Out',
classname: [CLASSNAME.zoomOut, CLASSNAME.icon].join(' '),
callback: function (obj, map) {
var view = map.getView(),
pan = ol.animation.pan({
duration: 1000,
source: view.getCenter()
}),
zoom = ol.animation.zoom({
duration: 1000,
resolution: view.getResolution()
});
map.beforeRender(pan, zoom);
view.setCenter(obj.coordinate);
view.setZoom(+view.getZoom() - 1);
var view = map.getView();
view.animate({
zoom: +view.getZoom() - 1,
duration: 700,
center: obj.coordinate
});
}
}
];
Expand Down Expand Up @@ -391,7 +378,7 @@ var Internal = function Internal(base) {
/**
* @type {Element}
*/
this.mapElement = undefined;
this.viewport = undefined;
/**
* @type {ol.Coordinate}
*/
Expand Down Expand Up @@ -428,7 +415,7 @@ var Internal = function Internal(base) {

Internal.prototype.init = function init (map) {
this.map = map;
this.mapElement = map.getTargetElement();
this.viewport = map.getViewport();
this.setListeners();
this.Base.Html.createMenu();

Expand Down Expand Up @@ -537,12 +524,12 @@ Internal.prototype.closeMenu = function closeMenu () {
};

Internal.prototype.setListeners = function setListeners () {
this.mapElement.addEventListener(
this.viewport.addEventListener(
this.Base.options.eventType, this.eventHandler, false);
};

Internal.prototype.removeListeners = function removeListeners () {
this.mapElement.removeEventListener(
this.viewport.removeEventListener(
this.Base.options.eventType, this.eventHandler, false);
};

Expand Down
6 changes: 3 additions & 3 deletions build/ol3-contextmenu.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*!
* ol3-contextmenu - v2.4.1
* Custom Context Menu for Openlayers 3
* ol3-contextmenu - v2.5.0
* Custom Context Menu for Openlayers
* https://github.com/jonataswalker/ol3-contextmenu
* Built: Fri Jan 27 2017 07:46:22 GMT-0200 (BRST)
* Built: Fri Feb 24 2017 15:11:23 GMT-0300 (BRT)
*/
.ol-ctx-menu-container {
position: absolute;
Expand Down
8 changes: 4 additions & 4 deletions build/ol3-contextmenu.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/ol3-contextmenu.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions build/ol3-contextmenu.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ol3-contextmenu",
"version": "2.4.1",
"description": "Custom Context Menu for Openlayers 3",
"version": "2.5.0",
"description": "Custom Context Menu for Openlayers",
"main": "build/ol3-contextmenu.js",
"author": "Jonatas Walker",
"homepage": "https://github.com/jonataswalker/ol3-contextmenu",
Expand Down

0 comments on commit 9153d87

Please sign in to comment.