Skip to content

Commit

Permalink
Code improvements and clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
rugoncalves committed Feb 27, 2024
1 parent 4ade74d commit 7974d58
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
10 changes: 2 additions & 8 deletions src/OSFramework/Maps/Event/Marker/MarkerEventsManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ namespace OSFramework.Maps.Event.Marker {
// The following events are being deprecated. They should get removed soon.
switch (eventType) {
case MarkerEventType.Initialized:
case MarkerEventType.OnMouseout:
case MarkerEventType.OnMouseover:
handlerEvent.trigger(
this._marker.map.widgetId, // Id of Map block that was initialized
this._marker.widgetId || this._marker.uniqueId, // Id of Marker block that was initialized
Expand All @@ -87,14 +89,6 @@ namespace OSFramework.Maps.Event.Marker {
...args // Coordinates retrieved from the marker event that got triggered
);
break;
case MarkerEventType.OnMouseout:
case MarkerEventType.OnMouseover:
handlerEvent.trigger(
this._marker.map.widgetId, // Id of Map block that was clicked
this._marker.widgetId || this._marker.uniqueId, // Id of Marker block that was clicked
this._marker.index // Index of Marker block that was clicked
);
break;
case MarkerEventType.OnEventTriggered:
handlerEvent.trigger(
this._marker.map.widgetId, // Id of Map block that triggered the event
Expand Down
8 changes: 3 additions & 5 deletions src/OutSystems/Maps/MapAPI/MarkerManager.Events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,11 @@ namespace OutSystems.Maps.MapAPI.MarkerManager.Events {
* @export
* @param {string} markerId Marker where the events will get attached
* @param {OSFramework.Maps.Event.Marker.MarkerEventType} eventName name of the event to get attached
* @param {OSFramework.Maps.Callbacks.Marker.ClickEvent} callback to be invoked when the event occurs
* @param {OSFramework.Maps.Callbacks.Marker.Event} callback to be invoked when the event occurs
*/
export function Subscribe(
markerId: string,
eventName: OSFramework.Maps.Event.Marker.MarkerEventType,
// eslint-disable-next-line
callback: OSFramework.Maps.Callbacks.Marker.Event
): string {
const responseObj = {
Expand Down Expand Up @@ -93,7 +92,7 @@ namespace OutSystems.Maps.MapAPI.MarkerManager.Events {
* @export
* @param {string} eventUniqueId Id of the Event to be attached
* @param {OSFramework.Maps.Event.Map.MapEventType} eventName name fo the event to be attached
* @param {MapAPI.Callbacks.OSMap.Event} callback callback to be invoked when the event occurs
* @param {OSFramework.Maps.Callbacks.Marker.Event} callback callback to be invoked when the event occurs
*/
export function SubscribeByUniqueId(
eventUniqueId: string,
Expand Down Expand Up @@ -150,12 +149,11 @@ namespace OutSystems.Maps.MapAPI.MarkerManager.Events {
* @export
* @param {string} eventUniqueId Map where the event will be removed
* @param {OSFramework.Maps.Event.Map.MapEventType} eventName name of the event to be removed
* @param {MapAPI.Callbacks.OSMap.Event} callback callback that will be removed
* @param {OSFramework.Maps.Callbacks.Marker.Event} callback callback that will be removed
*/
export function Unsubscribe(
eventUniqueId: string,
eventName: OSFramework.Maps.Event.Marker.MarkerEventType,
// eslint-disable-next-line
callback: OSFramework.Maps.Callbacks.Marker.Event
): void {
const markerId = GetMarkerIdByEventUniqueId(eventUniqueId);
Expand Down

0 comments on commit 7974d58

Please sign in to comment.