Skip to content

Commit

Permalink
v1.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
www committed Apr 8, 2016
2 parents 1bdff8b + fca336d commit e7aa4c5
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 29 deletions.
21 changes: 13 additions & 8 deletions dist/angular-openlayers-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,12 @@ angular.module('openlayers-directive').directive('olMarker', ["$log", "$q", "olM

// This function handles popup on mouse over/click
properties.handleInteraction = function(evt) {
if (properties.label.show) {
var ngClick = false;
if (attrs.hasOwnProperty('ngClick')) {
ngClick = true;
}

if (properties.label.show && !ngClick) {
return;
}
var found = false;
Expand All @@ -911,6 +916,12 @@ angular.module('openlayers-directive').directive('olMarker', ["$log", "$q", "olM
if (feature === marker) {
actionTaken = true;
found = true;
if (ngClick && (evt.type === 'click' || evt.type === 'touchend')) {
element.triggerHandler('click');
evt.preventDefault();
evt.stopPropagation();
return;
}
if (!isDefined(label)) {
if (data.projection === 'pixel') {
pos = properties.coord;
Expand All @@ -921,12 +932,6 @@ angular.module('openlayers-directive').directive('olMarker', ["$log", "$q", "olM
label = createOverlay(element, pos);
map.addOverlay(label);
}

if (properties.onClick && (evt.type === 'click' || evt.type === 'touchend')) {
scope.$apply(function() {
properties.onClick.call(marker, evt, properties);
});
}
map.getTarget().style.cursor = 'pointer';
}

Expand Down Expand Up @@ -1092,7 +1097,7 @@ angular.module('openlayers-directive').directive('olMarker', ["$log", "$q", "olM

if ((properties.label && properties.label.show === false &&
properties.label.showOnMouseClick) ||
properties.onClick) {
attrs.hasOwnProperty('ngClick')) {
map.getViewport().addEventListener('click', properties.handleTapInteraction);
map.getViewport().querySelector('canvas.ol-unselectable').addEventListener(
'touchend', properties.handleTapInteraction);
Expand Down
4 changes: 2 additions & 2 deletions dist/angular-openlayers-directive.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/angular-openlayers-directive.min.no-header.js

Large diffs are not rendered by default.

21 changes: 13 additions & 8 deletions dist/angular-openlayers-directive.pre.js
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,12 @@ angular.module('openlayers-directive').directive('olMarker', function($log, $q,

// This function handles popup on mouse over/click
properties.handleInteraction = function(evt) {
if (properties.label.show) {
var ngClick = false;
if (attrs.hasOwnProperty('ngClick')) {
ngClick = true;
}

if (properties.label.show && !ngClick) {
return;
}
var found = false;
Expand All @@ -911,6 +916,12 @@ angular.module('openlayers-directive').directive('olMarker', function($log, $q,
if (feature === marker) {
actionTaken = true;
found = true;
if (ngClick && (evt.type === 'click' || evt.type === 'touchend')) {
element.triggerHandler('click');
evt.preventDefault();
evt.stopPropagation();
return;
}
if (!isDefined(label)) {
if (data.projection === 'pixel') {
pos = properties.coord;
Expand All @@ -921,12 +932,6 @@ angular.module('openlayers-directive').directive('olMarker', function($log, $q,
label = createOverlay(element, pos);
map.addOverlay(label);
}

if (properties.onClick && (evt.type === 'click' || evt.type === 'touchend')) {
scope.$apply(function() {
properties.onClick.call(marker, evt, properties);
});
}
map.getTarget().style.cursor = 'pointer';
}

Expand Down Expand Up @@ -1092,7 +1097,7 @@ angular.module('openlayers-directive').directive('olMarker', function($log, $q,

if ((properties.label && properties.label.show === false &&
properties.label.showOnMouseClick) ||
properties.onClick) {
attrs.hasOwnProperty('ngClick')) {
map.getViewport().addEventListener('click', properties.handleTapInteraction);
map.getViewport().querySelector('canvas.ol-unselectable').addEventListener(
'touchend', properties.handleTapInteraction);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
},
"main": "dist/angular-openlayers-directive",
"version": "1.10.0"
"version": "1.11.0"
}
21 changes: 13 additions & 8 deletions src/directives/marker.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,12 @@ angular.module('openlayers-directive').directive('olMarker', function($log, $q,

// This function handles popup on mouse over/click
properties.handleInteraction = function(evt) {
if (properties.label.show) {
var ngClick = false;
if (attrs.hasOwnProperty('ngClick')) {
ngClick = true;
}

if (properties.label.show && !ngClick) {
return;
}
var found = false;
Expand All @@ -216,6 +221,12 @@ angular.module('openlayers-directive').directive('olMarker', function($log, $q,
if (feature === marker) {
actionTaken = true;
found = true;
if (ngClick && (evt.type === 'click' || evt.type === 'touchend')) {
element.triggerHandler('click');
evt.preventDefault();
evt.stopPropagation();
return;
}
if (!isDefined(label)) {
if (data.projection === 'pixel') {
pos = properties.coord;
Expand All @@ -226,12 +237,6 @@ angular.module('openlayers-directive').directive('olMarker', function($log, $q,
label = createOverlay(element, pos);
map.addOverlay(label);
}

if (properties.onClick && (evt.type === 'click' || evt.type === 'touchend')) {
scope.$apply(function() {
properties.onClick.call(marker, evt, properties);
});
}
map.getTarget().style.cursor = 'pointer';
}

Expand Down Expand Up @@ -397,7 +402,7 @@ angular.module('openlayers-directive').directive('olMarker', function($log, $q,

if ((properties.label && properties.label.show === false &&
properties.label.showOnMouseClick) ||
properties.onClick) {
attrs.hasOwnProperty('ngClick')) {
map.getViewport().addEventListener('click', properties.handleTapInteraction);
map.getViewport().querySelector('canvas.ol-unselectable').addEventListener(
'touchend', properties.handleTapInteraction);
Expand Down

0 comments on commit e7aa4c5

Please sign in to comment.