<MapView Id="map" @ref="@map"
MapViewSizeUnitType="MapViewSizeUnitType.Percentage"
MapUnit="@ThinkGeo.Core.GeographyUnit.Meter"
Center="@torringtonCenterPoint"
Zoom="15"
Width="100"
Height="100" OnCurrentExtentChanged="OnMapExtentChanged"
BackgroundColor="@(GeoColor.FromHtml("#ffffffff"))">
<OverlaysSetting>
<LayerOverlay id="customoverlay" TileCache="@tileCache"></LayerOverlay>
@*<layeroverlay id="vectorlayer" layers="@vlayers"></layeroverlay>*@
</OverlaysSetting>
<MapToolsSetting>
<MapTools>
<ZoomBarMapTool Location="ZoomBarLocation.LowerRight" />
</MapTools>
</MapToolsSetting>
</MapView>
@code{
public MapView? map;
private PointShape torringtonCenterPoint = new PointShape(-8137421.8, 5133000.0);
private FileRasterTileCache tileCache = new FileRasterTileCache("./Data/MapTileCache", "PNG", RasterTileFormat.Png);
protected override void OnInitialized()
{
}
protected override void OnAfterRender(bool firstRender)
{
mapControl.generalControl.Scale = "34353";
}
private void OnMapExtentChanged()
{
mapControl.generalControl.Scale = "5345";
}
OnAfterRender() is working, but OnMapExtentChanged() is not working.
Please help me.
Thanks.