Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass original event to map click event handlers #182

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/world-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@
* @param {Function} params.onRegionLabelShow <code>(Event e, Object label, String code)</code> Will be called right before the region label is going to be shown.
* @param {Function} params.onRegionOver <code>(Event e, String code)</code> Will be called on region mouse over event.
* @param {Function} params.onRegionOut <code>(Event e, String code)</code> Will be called on region mouse out event.
* @param {Function} params.onRegionClick <code>(Event e, String code)</code> Will be called on region click event.
* @param {Function} params.onRegionClick <code>(Event e, String code, Event originalEvent)</code> Will be called on region click event.
* @param {Function} params.onRegionSelected <code>(Event e, String code, Boolean isSelected, Array selectedRegions)</code> Will be called when region is (de)selected. <code>isSelected</code> parameter of the callback indicates whether region is selected or not. <code>selectedRegions</code> contains codes of all currently selected regions.
* @param {Function} params.onMarkerLabelShow <code>(Event e, Object label, String code)</code> Will be called right before the marker label is going to be shown.
* @param {Function} params.onMarkerOver <code>(Event e, String code)</code> Will be called on marker mouse over event.
* @param {Function} params.onMarkerOut <code>(Event e, String code)</code> Will be called on marker mouse out event.
* @param {Function} params.onMarkerClick <code>(Event e, String code)</code> Will be called on marker click event.
* @param {Function} params.onMarkerClick <code>(Event e, String code, Event originalEvent)</code> Will be called on marker click event.
* @param {Function} params.onMarkerSelected <code>(Event e, String code, Boolean isSelected, Array selectedMarkers)</code> Will be called when marker is (de)selected. <code>isSelected</code> parameter of the callback indicates whether marker is selected or not. <code>selectedMarkers</code> contains codes of all currently selected markers.
* @param {Function} params.onViewportChange <code>(Event e, Number scale)</code> Triggered when the map's viewport is changed (map was panned or zoomed).
*/
Expand Down Expand Up @@ -431,7 +431,7 @@ jvm.WorldMap.prototype = {
element = type == 'region' ? map.regions[code].element : map.markers[code].element;

if (!mouseMoved) {
map.container.trigger(clickEvent, [code]);
map.container.trigger(clickEvent, [code, e]);
if ((type === 'region' && map.params.regionsSelectable) || (type === 'marker' && map.params.markersSelectable)) {
if (!clickEvent.isDefaultPrevented()) {
if (map.params[type+'sSelectableOne']) {
Expand Down