mirror of
https://github.com/Leaflet/Leaflet.git
synced 2025-07-21 23:26:12 +00:00
Fix circle radius if L.CRS.Simple has inverted x axis (#9414)
Co-authored-by: Jerry Lin <jerrylin2488@gmail.com> Co-authored-by: Aaron Sharif <aaronsharif62@gmail.com> Co-authored-by: Florian Bischof <design.falke@gmail.com>
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import {expect} from 'chai';
|
||||
import {Circle, Map} from 'leaflet';
|
||||
import {Circle, Map, Util, CRS, Transformation} from 'leaflet';
|
||||
import {createContainer, removeMapContainer} from '../../SpecHelper.js';
|
||||
|
||||
describe('Circle', () => {
|
||||
@ -47,4 +47,22 @@ describe('Circle', () => {
|
||||
expect(bounds.getNorthEast()).nearLatLng([50.00179, 30.00279]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('CRS Simple', () => {
|
||||
it('returns a positive radius if the x axis of L.CRS.Simple is inverted', () => {
|
||||
map.remove();
|
||||
|
||||
const crs = Util.extend(CRS.Simple, {
|
||||
transformation: new Transformation(-1, 0, -1, 0),
|
||||
});
|
||||
map = new Map(container, {
|
||||
crs
|
||||
});
|
||||
map.setView([0, 0], 4);
|
||||
|
||||
const circle = new Circle([0, 0], {radius: 200}).addTo(map);
|
||||
|
||||
expect(circle._radius).to.eql(3200);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user