The map events and setting pins

We have maps, and we have the logic to save points of interest to databases and to move them in memory. The one thing we don't have is the code to handle the user actually creating and managing the pins from the map itself. It's time to rectify that situation and add in a MapEvents class that will handle this for us. Just like the MapGeocode, PinModel, and PinsModel classes, this class is a standalone implementation. Let's start by adding the following code:

export class MapEvents {  private readonly geocode: MapGeocode;  private infoBox: Microsoft.Maps.Infobox;  constructor(private map: Microsoft.Maps.Map, private pinsModel: PinsModel, private poi: PointsOfInterestService) {  }}

Infobox is the box that appears ...

Get Advanced TypeScript Programming Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.