I am new to SharpMap and never had any experience using any GIS.
How do I get sharpmap to display a google map and then show some points on it using the latitude and longitude values? (example: Point 1 latitude: -36.853427, longitude: 174.770385; Point 2 lat: -36.853333, long: 174.770496).
I am really stuck and would deeply appreciate any help.
Here's what I have so far:
using System;
using System.Drawing;
using System.Windows.Forms;
using SharpMap.Layers;
using BruTile.Web;
namespace sharp_map_test
{
public partial class Form1 : Form
{
double point1Lat = -36.853427;
double point1Long = 174.770385;
double point2Lat = -36.853333;
double point2Long = 174.770496;
public Form1()
{
InitializeComponent();
SharpMap.Map myMap = new SharpMap.Map(new Size(400, 300));
// Output size
myMap.Size = new System.Drawing.Size(300, 200);
// Minimum zoom allowed
myMap.MinimumZoom = 100;
// Set background
myMap.BackColor = Color.White;
var layergoogle = new TileLayer(new GoogleTileSource(GoogleMapType.GoogleMap), "googlemaps");
var layer = new VectorLayer("test");
myMap.Layers.Add(layergoogle);
// Render the map
myMap.ZoomToExtents();
System.Drawing.Image imgMap = myMap.GetMap();
}
private void Form1_Load(object sender, EventArgs e)
{
// Display point1Lat and point1Long point on the google map
// Add text saying "Device A" to the point.
// Display point2Lat and point2Long point on the google map
// Add text saying "Device B" to the point.
// Refresh map and get the correct zoom level
}
}
}