I am trying to get the latitude and longitude and create a table from it, and show in a map, using Leaflet, however I didn't find anything that could help me in my project, the files that I have made are the following:
class Local for the Location
using System.ComponentModel.DataAnnotations;
namespace maps.Models
{
public class Local
{
//[Key]
public int ID { get; set; }
public double latitude { get; set;}
public double longitude { get; set;}
//observe that
}
}
And for the table I use:
using Microsoft.EntityFrameworkCore;
using System;
using System.Linq;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace maps.Models
{
public class TestDbcontext : DbContext
{
public DbSet<Local> Locals { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder options)
=> options.UseSqlite(@"Data Source=C:\Users\joaov\Downloads\local.db");
}
}
I just could implement the following:
var map = L.map('map').setView([51.5, -0.09], 13);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
var seekPlace = L.Control.geocoder().addTo(map);
But it's far from what I want, which is, given latitude and longitude (Back-end), to put a marker on the map, and to show the saved data in a table.