Before opening an issue, make sure to read the
contributing guide
and understand this is a bug tracker, not a support platform.
Please make sure to check the following boxes before submitting an issue.
Issues opened without using this template will be closed unless they have a good
reason not to follow this template.
I just have a question. I was wondering if there was support for non-geographical maps as described in http://leafletjs.com/examples/crs-simple/crs-simple.html. I looked through the API but could not find a way to set a simple coordinate reference system. Is there an option for this?
Could not find mention throughout the docs.
Please provide the simplest example possible to reproduce the issue, based on
this CodePen.
You can inject any option supported by a Leaflet layer in the corresponding component, so the example from
var map = L.map('map', {
crs: L.CRS.Simple
});
roughly translates to
<Map crs={L.CRS.Simple} ...>...</Map>
@PaulLeCam
Just a suggestion: document this somewhere. I'm going to guess people new to this library don't know where to find this information.
@lambdakris
In case you're interested:
import React from 'react'
import { Map, ImageOverlay, Marker, Popup } from 'react-leaflet'
import L from 'leaflet'
const bounds = [[0, 0], [1900, 2546]]
const style = { height: '80vh', width: '75vw' }
export default class SimpleExample extends React.Component {
render() {
return (
<Map crs={L.CRS.Simple} minZoom={-4} bounds={bounds} style={style}>
<ImageOverlay
bounds={bounds}
url="https://beamtech-file.s3.amazonaws.com/company/3/6dcbca6e-574d-410b-b732-b6ba0865ed06-hermitage-standard-lhs-2546x1900_0.png"
/>
<Marker position={[1000, 1000]}>
<Popup>
A pretty CSS3 popup. <br /> Easily customizable.
</Popup>
</Marker>
</Map>
)
}
}
Most helpful comment
@lambdakris
In case you're interested: