Closed Casen closed 9 years ago
Proj4's defs
dictionary should be shared throughout the app, so as long as you get the requirement ordering correct, using defs should work - as long as you use one Proj4 version throughout your code (which seems like a sensible thing to do anyway). Or am I missing some detail?
You can also provide a proj4
object to L.Proj.CRS
's constructor, and avoid using defs altogether, if that makes it easier.
Yes, this works fine with Browserify, maybe something like
require('proj4leaflet')
proj4 = require('proj4')
proj4.defs({your crs})
As mentioned, check there is only one proj4
in your browserified output and/or npm dedupe
.
@rob-murray yes, good advice. Thanks for sharing!
Not much more to say than that. Proj4leaflet requires proj4 internally, passing it to a factory function. This prevents a user from defining a new projection somewhere down in their code. Perhaps we could add "defs" to the proj4leaflet api?