ts-overlapping-marker-spiderfier
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -120,3 +120,3 @@ define(['exports'], function (exports) { 'use strict'; | ||
} | ||
if (this.formatTimeoutId != null) { | ||
if (this.formatTimeoutId) { | ||
return; | ||
@@ -126,10 +126,10 @@ } // only format markers once per run loop (in case e.g. being called repeatedly from addMarker) | ||
_this.formatTimeoutId = null; | ||
if (_this.projectionHelper.getProjection() != null) { | ||
if (_this.projectionHelper.getProjection()) { | ||
return _this.doFormatMarkers(); | ||
} | ||
if (_this.formatIdleListener != null) { | ||
if (_this.formatIdleListener) { | ||
return; | ||
} // if the map is not yet ready, and we're not already waiting, wait until it is ready | ||
return _this.formatIdleListener = google.maps.event.addListenerOnce(_this.map, 'idle', function () { return _this.doFormatMarkers(); }); | ||
}, 0); | ||
}, 50); | ||
}; | ||
@@ -184,3 +184,3 @@ OverlappingMarkerSpiderfier.prototype.generatePtsCircle = function (count, centerPt) { | ||
} | ||
if (marker['_omsData'] != null && (positionChanged || !marker.getVisible())) { | ||
if (marker['_omsData'] && (positionChanged || !marker.getVisible())) { | ||
this.unspiderfy(positionChanged ? marker : null); | ||
@@ -198,3 +198,3 @@ } | ||
var mData = this.markers.map(function (marker) { return ({ | ||
pt: _this.llToPt((marker['_omsData'] != null ? marker['_omsData'].usualPosition : undefined) != null ? marker['_omsData'] != null ? marker['_omsData'].usualPosition : undefined : marker.position), | ||
pt: _this.llToPt(marker['_omsData'] && marker['_omsData'].usualPosition || marker.position), | ||
willSpiderfy: false | ||
@@ -304,3 +304,3 @@ }); }); | ||
OverlappingMarkerSpiderfier.prototype.spiderListener = function (marker, event) { | ||
var markerSpiderfied = marker['_omsData'] != null; | ||
var markerSpiderfied = !!marker['_omsData']; | ||
if (!markerSpiderfied || !this.keepSpiderfied) { | ||
@@ -353,3 +353,3 @@ this.unspiderfy(); | ||
var _this = this; | ||
if (marker['_oms'] != null) { | ||
if (marker['_oms']) { | ||
return this; | ||
@@ -368,3 +368,3 @@ } | ||
} | ||
if (spiderClickHandler != null) { | ||
if (spiderClickHandler) { | ||
listenerRefs.push(google.maps.event.addListener(marker, 'spider_click', spiderClickHandler)); | ||
@@ -391,3 +391,3 @@ } | ||
OverlappingMarkerSpiderfier.prototype.forgetMarker = function (marker) { | ||
if (marker['_omsData'] != null) { | ||
if (marker['_omsData']) { | ||
this.unspiderfy(); | ||
@@ -457,3 +457,3 @@ } | ||
} | ||
var mPt = this.llToPt((current['_omsData'] != null ? current['_omsData'].usualPosition : undefined) != null ? current['_omsData'] != null ? current['_omsData'].usualPosition : undefined : current.position); | ||
var mPt = this.llToPt(current['_omsData'] && current['_omsData'].usualPosition || current.position); | ||
if (OverlappingMarkerSpiderfier.ptDistanceSq(mPt, markerPt) < pxSq) { | ||
@@ -490,3 +490,3 @@ markers.push(current); | ||
var marker = this.markers[i]; | ||
if (marker['_omsData'] != null) { | ||
if (marker['_omsData']) { | ||
marker['_omsData'].leg.setMap(null); | ||
@@ -498,3 +498,3 @@ if (marker !== markerNotToMove) { | ||
var listeners = marker['_omsData'].hightlightListeners; | ||
if (listeners != null) { | ||
if (listeners) { | ||
google.maps.event.removeListener(listeners.highlight); | ||
@@ -501,0 +501,0 @@ google.maps.event.removeListener(listeners.unhighlight); |
@@ -121,3 +121,3 @@ var OMS = (function (exports) { | ||
} | ||
if (this.formatTimeoutId != null) { | ||
if (this.formatTimeoutId) { | ||
return; | ||
@@ -127,10 +127,10 @@ } // only format markers once per run loop (in case e.g. being called repeatedly from addMarker) | ||
_this.formatTimeoutId = null; | ||
if (_this.projectionHelper.getProjection() != null) { | ||
if (_this.projectionHelper.getProjection()) { | ||
return _this.doFormatMarkers(); | ||
} | ||
if (_this.formatIdleListener != null) { | ||
if (_this.formatIdleListener) { | ||
return; | ||
} // if the map is not yet ready, and we're not already waiting, wait until it is ready | ||
return _this.formatIdleListener = google.maps.event.addListenerOnce(_this.map, 'idle', function () { return _this.doFormatMarkers(); }); | ||
}, 0); | ||
}, 50); | ||
}; | ||
@@ -185,3 +185,3 @@ OverlappingMarkerSpiderfier.prototype.generatePtsCircle = function (count, centerPt) { | ||
} | ||
if (marker['_omsData'] != null && (positionChanged || !marker.getVisible())) { | ||
if (marker['_omsData'] && (positionChanged || !marker.getVisible())) { | ||
this.unspiderfy(positionChanged ? marker : null); | ||
@@ -199,3 +199,3 @@ } | ||
var mData = this.markers.map(function (marker) { return ({ | ||
pt: _this.llToPt((marker['_omsData'] != null ? marker['_omsData'].usualPosition : undefined) != null ? marker['_omsData'] != null ? marker['_omsData'].usualPosition : undefined : marker.position), | ||
pt: _this.llToPt(marker['_omsData'] && marker['_omsData'].usualPosition || marker.position), | ||
willSpiderfy: false | ||
@@ -305,3 +305,3 @@ }); }); | ||
OverlappingMarkerSpiderfier.prototype.spiderListener = function (marker, event) { | ||
var markerSpiderfied = marker['_omsData'] != null; | ||
var markerSpiderfied = !!marker['_omsData']; | ||
if (!markerSpiderfied || !this.keepSpiderfied) { | ||
@@ -354,3 +354,3 @@ this.unspiderfy(); | ||
var _this = this; | ||
if (marker['_oms'] != null) { | ||
if (marker['_oms']) { | ||
return this; | ||
@@ -369,3 +369,3 @@ } | ||
} | ||
if (spiderClickHandler != null) { | ||
if (spiderClickHandler) { | ||
listenerRefs.push(google.maps.event.addListener(marker, 'spider_click', spiderClickHandler)); | ||
@@ -392,3 +392,3 @@ } | ||
OverlappingMarkerSpiderfier.prototype.forgetMarker = function (marker) { | ||
if (marker['_omsData'] != null) { | ||
if (marker['_omsData']) { | ||
this.unspiderfy(); | ||
@@ -458,3 +458,3 @@ } | ||
} | ||
var mPt = this.llToPt((current['_omsData'] != null ? current['_omsData'].usualPosition : undefined) != null ? current['_omsData'] != null ? current['_omsData'].usualPosition : undefined : current.position); | ||
var mPt = this.llToPt(current['_omsData'] && current['_omsData'].usualPosition || current.position); | ||
if (OverlappingMarkerSpiderfier.ptDistanceSq(mPt, markerPt) < pxSq) { | ||
@@ -491,3 +491,3 @@ markers.push(current); | ||
var marker = this.markers[i]; | ||
if (marker['_omsData'] != null) { | ||
if (marker['_omsData']) { | ||
marker['_omsData'].leg.setMap(null); | ||
@@ -499,3 +499,3 @@ if (marker !== markerNotToMove) { | ||
var listeners = marker['_omsData'].hightlightListeners; | ||
if (listeners != null) { | ||
if (listeners) { | ||
google.maps.event.removeListener(listeners.highlight); | ||
@@ -502,0 +502,0 @@ google.maps.event.removeListener(listeners.unhighlight); |
@@ -122,3 +122,3 @@ 'use strict'; | ||
} | ||
if (this.formatTimeoutId != null) { | ||
if (this.formatTimeoutId) { | ||
return; | ||
@@ -128,10 +128,10 @@ } // only format markers once per run loop (in case e.g. being called repeatedly from addMarker) | ||
_this.formatTimeoutId = null; | ||
if (_this.projectionHelper.getProjection() != null) { | ||
if (_this.projectionHelper.getProjection()) { | ||
return _this.doFormatMarkers(); | ||
} | ||
if (_this.formatIdleListener != null) { | ||
if (_this.formatIdleListener) { | ||
return; | ||
} // if the map is not yet ready, and we're not already waiting, wait until it is ready | ||
return _this.formatIdleListener = google.maps.event.addListenerOnce(_this.map, 'idle', function () { return _this.doFormatMarkers(); }); | ||
}, 0); | ||
}, 50); | ||
}; | ||
@@ -186,3 +186,3 @@ OverlappingMarkerSpiderfier.prototype.generatePtsCircle = function (count, centerPt) { | ||
} | ||
if (marker['_omsData'] != null && (positionChanged || !marker.getVisible())) { | ||
if (marker['_omsData'] && (positionChanged || !marker.getVisible())) { | ||
this.unspiderfy(positionChanged ? marker : null); | ||
@@ -200,3 +200,3 @@ } | ||
var mData = this.markers.map(function (marker) { return ({ | ||
pt: _this.llToPt((marker['_omsData'] != null ? marker['_omsData'].usualPosition : undefined) != null ? marker['_omsData'] != null ? marker['_omsData'].usualPosition : undefined : marker.position), | ||
pt: _this.llToPt(marker['_omsData'] && marker['_omsData'].usualPosition || marker.position), | ||
willSpiderfy: false | ||
@@ -306,3 +306,3 @@ }); }); | ||
OverlappingMarkerSpiderfier.prototype.spiderListener = function (marker, event) { | ||
var markerSpiderfied = marker['_omsData'] != null; | ||
var markerSpiderfied = !!marker['_omsData']; | ||
if (!markerSpiderfied || !this.keepSpiderfied) { | ||
@@ -355,3 +355,3 @@ this.unspiderfy(); | ||
var _this = this; | ||
if (marker['_oms'] != null) { | ||
if (marker['_oms']) { | ||
return this; | ||
@@ -370,3 +370,3 @@ } | ||
} | ||
if (spiderClickHandler != null) { | ||
if (spiderClickHandler) { | ||
listenerRefs.push(google.maps.event.addListener(marker, 'spider_click', spiderClickHandler)); | ||
@@ -393,3 +393,3 @@ } | ||
OverlappingMarkerSpiderfier.prototype.forgetMarker = function (marker) { | ||
if (marker['_omsData'] != null) { | ||
if (marker['_omsData']) { | ||
this.unspiderfy(); | ||
@@ -459,3 +459,3 @@ } | ||
} | ||
var mPt = this.llToPt((current['_omsData'] != null ? current['_omsData'].usualPosition : undefined) != null ? current['_omsData'] != null ? current['_omsData'].usualPosition : undefined : current.position); | ||
var mPt = this.llToPt(current['_omsData'] && current['_omsData'].usualPosition || current.position); | ||
if (OverlappingMarkerSpiderfier.ptDistanceSq(mPt, markerPt) < pxSq) { | ||
@@ -492,3 +492,3 @@ markers.push(current); | ||
var marker = this.markers[i]; | ||
if (marker['_omsData'] != null) { | ||
if (marker['_omsData']) { | ||
marker['_omsData'].leg.setMap(null); | ||
@@ -500,3 +500,3 @@ if (marker !== markerNotToMove) { | ||
var listeners = marker['_omsData'].hightlightListeners; | ||
if (listeners != null) { | ||
if (listeners) { | ||
google.maps.event.removeListener(listeners.highlight); | ||
@@ -503,0 +503,0 @@ google.maps.event.removeListener(listeners.unhighlight); |
@@ -124,3 +124,3 @@ (function (global, factory) { | ||
} | ||
if (this.formatTimeoutId != null) { | ||
if (this.formatTimeoutId) { | ||
return; | ||
@@ -130,10 +130,10 @@ } // only format markers once per run loop (in case e.g. being called repeatedly from addMarker) | ||
_this.formatTimeoutId = null; | ||
if (_this.projectionHelper.getProjection() != null) { | ||
if (_this.projectionHelper.getProjection()) { | ||
return _this.doFormatMarkers(); | ||
} | ||
if (_this.formatIdleListener != null) { | ||
if (_this.formatIdleListener) { | ||
return; | ||
} // if the map is not yet ready, and we're not already waiting, wait until it is ready | ||
return _this.formatIdleListener = google.maps.event.addListenerOnce(_this.map, 'idle', function () { return _this.doFormatMarkers(); }); | ||
}, 0); | ||
}, 50); | ||
}; | ||
@@ -188,3 +188,3 @@ OverlappingMarkerSpiderfier.prototype.generatePtsCircle = function (count, centerPt) { | ||
} | ||
if (marker['_omsData'] != null && (positionChanged || !marker.getVisible())) { | ||
if (marker['_omsData'] && (positionChanged || !marker.getVisible())) { | ||
this.unspiderfy(positionChanged ? marker : null); | ||
@@ -202,3 +202,3 @@ } | ||
var mData = this.markers.map(function (marker) { return ({ | ||
pt: _this.llToPt((marker['_omsData'] != null ? marker['_omsData'].usualPosition : undefined) != null ? marker['_omsData'] != null ? marker['_omsData'].usualPosition : undefined : marker.position), | ||
pt: _this.llToPt(marker['_omsData'] && marker['_omsData'].usualPosition || marker.position), | ||
willSpiderfy: false | ||
@@ -308,3 +308,3 @@ }); }); | ||
OverlappingMarkerSpiderfier.prototype.spiderListener = function (marker, event) { | ||
var markerSpiderfied = marker['_omsData'] != null; | ||
var markerSpiderfied = !!marker['_omsData']; | ||
if (!markerSpiderfied || !this.keepSpiderfied) { | ||
@@ -357,3 +357,3 @@ this.unspiderfy(); | ||
var _this = this; | ||
if (marker['_oms'] != null) { | ||
if (marker['_oms']) { | ||
return this; | ||
@@ -372,3 +372,3 @@ } | ||
} | ||
if (spiderClickHandler != null) { | ||
if (spiderClickHandler) { | ||
listenerRefs.push(google.maps.event.addListener(marker, 'spider_click', spiderClickHandler)); | ||
@@ -395,3 +395,3 @@ } | ||
OverlappingMarkerSpiderfier.prototype.forgetMarker = function (marker) { | ||
if (marker['_omsData'] != null) { | ||
if (marker['_omsData']) { | ||
this.unspiderfy(); | ||
@@ -461,3 +461,3 @@ } | ||
} | ||
var mPt = this.llToPt((current['_omsData'] != null ? current['_omsData'].usualPosition : undefined) != null ? current['_omsData'] != null ? current['_omsData'].usualPosition : undefined : current.position); | ||
var mPt = this.llToPt(current['_omsData'] && current['_omsData'].usualPosition || current.position); | ||
if (OverlappingMarkerSpiderfier.ptDistanceSq(mPt, markerPt) < pxSq) { | ||
@@ -494,3 +494,3 @@ markers.push(current); | ||
var marker = this.markers[i]; | ||
if (marker['_omsData'] != null) { | ||
if (marker['_omsData']) { | ||
marker['_omsData'].leg.setMap(null); | ||
@@ -502,3 +502,3 @@ if (marker !== markerNotToMove) { | ||
var listeners = marker['_omsData'].hightlightListeners; | ||
if (listeners != null) { | ||
if (listeners) { | ||
google.maps.event.removeListener(listeners.highlight); | ||
@@ -505,0 +505,0 @@ google.maps.event.removeListener(listeners.unhighlight); |
@@ -129,3 +129,3 @@ var __extends = (this && this.__extends) || (function () { | ||
} | ||
if (this.formatTimeoutId != null) { | ||
if (this.formatTimeoutId) { | ||
return; | ||
@@ -135,10 +135,10 @@ } // only format markers once per run loop (in case e.g. being called repeatedly from addMarker) | ||
_this.formatTimeoutId = null; | ||
if (_this.projectionHelper.getProjection() != null) { | ||
if (_this.projectionHelper.getProjection()) { | ||
return _this.doFormatMarkers(); | ||
} | ||
if (_this.formatIdleListener != null) { | ||
if (_this.formatIdleListener) { | ||
return; | ||
} // if the map is not yet ready, and we're not already waiting, wait until it is ready | ||
return _this.formatIdleListener = google.maps.event.addListenerOnce(_this.map, 'idle', function () { return _this.doFormatMarkers(); }); | ||
}, 0); | ||
}, 50); | ||
}; | ||
@@ -193,3 +193,3 @@ OverlappingMarkerSpiderfier.prototype.generatePtsCircle = function (count, centerPt) { | ||
} | ||
if (marker['_omsData'] != null && (positionChanged || !marker.getVisible())) { | ||
if (marker['_omsData'] && (positionChanged || !marker.getVisible())) { | ||
this.unspiderfy(positionChanged ? marker : null); | ||
@@ -207,3 +207,3 @@ } | ||
var mData = this.markers.map(function (marker) { return ({ | ||
pt: _this.llToPt((marker['_omsData'] != null ? marker['_omsData'].usualPosition : undefined) != null ? marker['_omsData'] != null ? marker['_omsData'].usualPosition : undefined : marker.position), | ||
pt: _this.llToPt(marker['_omsData'] && marker['_omsData'].usualPosition || marker.position), | ||
willSpiderfy: false | ||
@@ -313,3 +313,3 @@ }); }); | ||
OverlappingMarkerSpiderfier.prototype.spiderListener = function (marker, event) { | ||
var markerSpiderfied = marker['_omsData'] != null; | ||
var markerSpiderfied = !!marker['_omsData']; | ||
if (!markerSpiderfied || !this.keepSpiderfied) { | ||
@@ -362,3 +362,3 @@ this.unspiderfy(); | ||
var _this = this; | ||
if (marker['_oms'] != null) { | ||
if (marker['_oms']) { | ||
return this; | ||
@@ -377,3 +377,3 @@ } | ||
} | ||
if (spiderClickHandler != null) { | ||
if (spiderClickHandler) { | ||
listenerRefs.push(google.maps.event.addListener(marker, 'spider_click', spiderClickHandler)); | ||
@@ -400,3 +400,3 @@ } | ||
OverlappingMarkerSpiderfier.prototype.forgetMarker = function (marker) { | ||
if (marker['_omsData'] != null) { | ||
if (marker['_omsData']) { | ||
this.unspiderfy(); | ||
@@ -466,3 +466,3 @@ } | ||
} | ||
var mPt = this.llToPt((current['_omsData'] != null ? current['_omsData'].usualPosition : undefined) != null ? current['_omsData'] != null ? current['_omsData'].usualPosition : undefined : current.position); | ||
var mPt = this.llToPt(current['_omsData'] && current['_omsData'].usualPosition || current.position); | ||
if (OverlappingMarkerSpiderfier.ptDistanceSq(mPt, markerPt) < pxSq) { | ||
@@ -499,3 +499,3 @@ markers.push(current); | ||
var marker = this.markers[i]; | ||
if (marker['_omsData'] != null) { | ||
if (marker['_omsData']) { | ||
marker['_omsData'].leg.setMap(null); | ||
@@ -507,3 +507,3 @@ if (marker !== markerNotToMove) { | ||
var listeners = marker['_omsData'].hightlightListeners; | ||
if (listeners != null) { | ||
if (listeners) { | ||
google.maps.event.removeListener(listeners.highlight); | ||
@@ -510,0 +510,0 @@ google.maps.event.removeListener(listeners.unhighlight); |
{ | ||
"name": "ts-overlapping-marker-spiderfier", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Overlapping Marker Spiderfier", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
402958