/// <inheritdoc/> public Task SaveMetadataAsync(IMapMetadata metadata) => Task.CompletedTask;
public InMemoryChunkStorage(IMapMetadata metadata) { _meta = metadata; }
public Task SaveMetadataAsync(IMapMetadata metadata) { throw new NotImplementedException(); }
public Image GetMapLayer(IMapMetadata analyticMapMetadata, MapRequest mapRequest) { MapDescription mapDescription = mapRequest.MapDescription; IEnumerable<MapPushpin> pushpinDescriptions = mapRequest.Pushpins; if (pushpinDescriptions == null || !pushpinDescriptions.Any()) { throw new ArgumentNullException("pushpinDescriptions"); } if (analyticMapMetadata == null) { throw new ArgumentNullException("analyticMapMetadata"); } if (mapDescription == null) { throw new ArgumentNullException("mapDescription"); } var scaleFactor = mapDescription.MapImageScaleFactor; var width = (int)(analyticMapMetadata.MapWidth * scaleFactor); var height = (int)(analyticMapMetadata.MapHeight * scaleFactor); var image = new Bitmap(width, height); using (var g = Graphics.FromImage(image)) { g.Clear(Color.Transparent); foreach (var pushPinDescription in pushpinDescriptions.OrderBy(pp => pp.Zindex)) { var pushPinMetadata = this.GetPushpinMetadata(pushPinDescription.Coordinate, analyticMapMetadata); if (pushPinMetadata == null) { continue; } var pushPinImage = this.GetPushPinImage( pushPinDescription.CustomPushpinIcon, pushPinDescription.Label, mapDescription); if (pushPinImage == null) { continue; } var pushPinOffsetX = GetPushPinOffsetX(pushPinMetadata, scaleFactor, pushPinImage); var pushPinOffsetY = GetPushPinOffsetY( pushPinMetadata, scaleFactor, pushPinImage); g.DrawImage(pushPinImage, pushPinOffsetX, pushPinOffsetY, pushPinImage.Width, pushPinImage.Height); } g.Flush(); } return image; }
private BingPushpinMetadata GetPushpinMetadata( MapPoint coordinate, IMapMetadata analyticMapMetadata) { BingPushpinMetadata selectedPushpin = null; foreach (var pin in analyticMapMetadata.Pushpins) { // index latituide = 0, longitude = 1 ////if(Math.Abs(pin.point.coordinates[0] - (double)coordinate.Latitude) < TOLERANCE) if (pin.BingPointMetadata.Coordinates[0] == (double)coordinate.Latitude && pin.BingPointMetadata.Coordinates[1] == (double)coordinate.Longitude) { selectedPushpin = pin; break; } } return selectedPushpin; }
public OrganizationMapper(IMapMetadata metadataMapper) { this.metadataMapper = metadataMapper ?? throw new ArgumentNullException(nameof(metadataMapper)); }