ichim / LeafletForBlazor-NuGet

LeafletForBlazor NuGet Package - You can quickly add a map control to your Blazor application - 2.0.6.8 version. Tooltips customization.
https://www.nuget.org/packages/LeafletForBlazor#versions-body-tab
56 stars 5 forks source link

Custom CRS Support #37

Open Alexr03 opened 1 week ago

Alexr03 commented 1 week ago

Hey! Great library! I am really wanting to use this to show a game map (not the real world map). To do this I need to apply a custom CRS.

CUSTOM_CRS = L.extend({}, L.CRS.Simple, {
    projection: L.Projection.LonLat,
    scale: function(zoom) {
        return Math.pow(2, zoom);
    },
    zoom: function(sc) {
        return Math.log(sc) / 0.6931471805599453;
    },
    distance: function(pos1, pos2) {
        let x_difference = pos2.lng - pos1.lng;
        let y_difference = pos2.lat - pos1.lat;
        return Math.sqrt(x_difference * x_difference + y_difference * y_difference);
    },
    transformation: new L.Transformation(scale_x, center_x, -scale_y, center_y),
    infinite: true,
});

Im unsure whether this library can currently do this, if not I would love to see this functionality added! :)

Thanks.

ichim commented 1 week ago

Hello sir,

Not, for this moment. Thanks a lot for your ideea. You can provides more information about your project?