From 400e81431d22294ab6f3d461261c74dabffdc7e5 Mon Sep 17 00:00:00 2001 From: "Milan P. Antonovic" Date: Thu, 9 Apr 2015 16:10:56 +0200 Subject: [PATCH] PointerEventHandler exception with Overlay containing SVG Using an ol.Overlay as marker I put inside an SVG graphic element. As soon I move the mouse over the SVG the error appear. In IE9 the SVG Element does not have the contains function so it throws the exception, on the contrary using goog.dom.contains it handles the cross-browser issues. https://groups.google.com/forum/#!topic/ol3-dev/DBi2HCTqulU --- src/ol/pointer/pointereventhandler.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ol/pointer/pointereventhandler.js b/src/ol/pointer/pointereventhandler.js index 367fb77193..80a972917d 100644 --- a/src/ol/pointer/pointereventhandler.js +++ b/src/ol/pointer/pointereventhandler.js @@ -31,6 +31,7 @@ goog.provide('ol.pointer.PointerEventHandler'); goog.require('goog.array'); +goog.require('goog.dom'); goog.require('goog.events'); goog.require('goog.events.BrowserEvent'); goog.require('goog.events.Event'); @@ -367,7 +368,10 @@ ol.pointer.PointerEventHandler.prototype.enterOver = */ ol.pointer.PointerEventHandler.prototype.contains_ = function(container, contained) { - return container.contains(contained); + if (goog.isNull(contained)) { + return false; + } + return goog.dom.contains(container, contained); };