This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private initilizeMap(): void { | |
// | |
// Create placeholders for markers | |
// | |
this.markers = []; | |
for (let i = 0; i < MapComponent.MaxNumMarkers; i++) { | |
this.markers.push(new Feature({})); | |
} | |
this.userMarker = new Feature(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="attribution"></div> | |
<div id="map" class="map"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yarn add ol | |
yarn add @types/ol --dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using LocPoc.Contracts; | |
using Microsoft.EntityFrameworkCore; | |
using System; | |
using System.Collections.Generic; | |
using System.Threading.Tasks; | |
namespace LocPoc.Repository.Sqlite | |
{ | |
public class LocationsRepositoryAsync : ILocationsRepositoryAsync | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.Threading.Tasks; | |
namespace LocPoc.Contracts | |
{ | |
public interface ILocationsRepositoryAsync | |
{ | |
Task<IEnumerable<Location>> GetAllAsync(); | |
Task<Location> GetAsync(string id); | |
Task<Location> CreateAsync(Location location); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace LocPoc.Api.Controllers | |
{ | |
[Route("api/[controller]")] | |
[ApiController] | |
public class LocationsController : ControllerBase | |
{ | |
ILocationsRepositoryAsync _locationsRepository; | |
public LocationsController(ILocationsRepositoryAsync locationsRepository) | |
{ | |
_locationsRepository = locationsRepository ?? throw new ArgumentNullException(nameof(locationsRepository)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.EntityFrameworkCore; | |
using LocPoc.Contracts; | |
namespace LocPoc.Repository.Sqlite | |
{ | |
public class SqliteContext: DbContext | |
{ | |
public SqliteContext(DbContextOptions<SqliteContext> options) : base(options) | |
{ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using LocPoc.Contracts; | |
using System; | |
using System.Collections.Generic; | |
namespace LocPoc.Repository.Sqlite | |
{ | |
public class LocationsRepository : ILocationsRepository | |
{ | |
private readonly SqliteContext _context; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
namespace LocPoc.Contracts | |
{ | |
public interface ILocationsRepository | |
{ | |
IEnumerable<Location> GetAll(); | |
Location Get(string id); | |
Location Create(Location location); | |
Location Update(Location location); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"apiUrl": "https://localhost", | |
"apiPort": "5001", | |
"useFakeData": false, | |
"useMap": true, | |
"googleAPIKey": "ABzaDuAQbFxSalDaWfIAB7DEZAh730AFGGGlpg" | |
} |