",
+ pixelOffset: [0, -30]
+ })
+ });
+
+ //add the markers to thwe map
+ incidentsMap.markers.add(pinMarker);
+
+ //Add on mouse enter event to toggle the popup.
+ incidentsMap.events.add('mouseenter', pinMarker, () => {
+ pinMarker.togglePopup();
+ });
+ }
+ catch (error) {
+ console.error(constants.errorLogPrefix + "_Error parsing coordinates:", error);
+ }
+ });
+
} catch (error) {
- console.log(error);
console.error(
- constants.errorLogPrefix + "_MapViewer_FormatData \n",
+ constants.errorLogPrefix + "_MapViewer_initMap \n",
JSON.stringify(error)
);
this.props.showMessageBar(this.props.localeStrings.genericErrorMessage + ", " + this.props.localeStrings.formatIncidentsDataFailedErrMsg, constants.messageBarType.error);
- // Log Exception
- this.dataService.trackException(this.props.appInsights, error, constants.componentNames.MapViewer, 'FormatIncidentData', this.props.userPrincipalName);
+ // Log Exception in App insights
+ this.dataService.trackException(this.props.appInsights, error, constants.componentNames.MapViewer, 'InitMap', this.props.userPrincipalName);
}
}
@@ -86,17 +127,8 @@ export class MapViewer extends React.Component