Hi,
I want to show data that doesn’t really belong on any known grid. I wanted to setup my map such that I can see the markers, and also a scale bar. In the future, I’d like to add a shapefile, grid, etc.
The code below shows 3 points from my datafile, that I wanted shown on the map. The points do show, however, the ScaleLineAdornmentLayer does not. I’ve also put these points into the MapSuite GIS editor, and I can get it to show the scale bar properly.
I’m wondering if there is a default projection (or some other setting) I can use to make my map show in the same was as the MS GIS editor?
(Note, because these are client supplied files, I don’t really have any idea of
the range of points to be displayed (eg in one file the X coordinate could
range from 0-300, in another it might be 50,000-60,000, but in all cases, assume the data is 1::1m
Thanks,
Steve
private
void
Window_Loaded(
object
sender, RoutedEventArgs e)
{
//wpfMap.MapUnit = GeographyUnit.Meter;
wpfMap.MapUnit = GeographyUnit.DecimalDegree;
wpfMap.ZoomLevelSet =
new
GoogleMapsZoomLevelSet();
var pointLayer =
new
InMemoryMarkerOverlay();
pointLayer.Columns.Add(
new
FeatureSourceColumn(
“HOLEID”
));
var uri =
new
Uri(@
“D:\Temp\AQUA.png”
);
pointLayer.ZoomLevelSet.ZoomLevel01.DefaultPointMarkerStyle.ImageSource =
new
BitmapImage(uri);
pointLayer.ZoomLevelSet.ZoomLevel01.DefaultPointMarkerStyle.Width = 20;
pointLayer.ZoomLevelSet.ZoomLevel01.DefaultPointMarkerStyle.Height = 34;
pointLayer.ZoomLevelSet.ZoomLevel01.DefaultPointMarkerStyle.YOffset = -17;
pointLayer.ZoomLevelSet.ZoomLevel01.DefaultPointMarkerStyle.ToolTip =
“This is [#HOLEID#].”
;
pointLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
wpfMap.Overlays.Add(pointLayer);
pointLayer.FeatureSource.BeginTransaction();
var pointShape =
new
PointShape(60950.578, 10671.408);
var pointFeature =
new
Feature(pointShape);
pointFeature.ColumnValues[
“HOLEID”
] =
“1”
;
pointLayer.FeatureSource.AddFeature(pointFeature);
pointShape =
new
PointShape(60950.894, 10675.447);
pointFeature =
new
Feature(pointShape);
pointFeature.ColumnValues[
“HOLEID”
] =
“2”
;
pointLayer.FeatureSource.AddFeature(pointFeature);
pointShape =
new
PointShape(60950.928, 10680.07);
pointFeature =
new
Feature(pointShape);
pointFeature.ColumnValues[
“HOLEID”
] =
“3”
;
pointLayer.FeatureSource.AddFeature(pointFeature);
pointLayer.FeatureSource.CommitTransaction();
// scale adorner
var scaleLineAdornmentLayer =
new
ScaleLineAdornmentLayer();
wpfMap.AdornmentOverlay.Layers.Add(
“ScaleLineAdornmentLayer”
, scaleLineAdornmentLayer);
wpfMap.Refresh();
}
blastholecollars5204002.zip (2.39 KB)