Closed Thermometer91 closed 10 years ago
From what you write, it sounds like you are dealing with some form of non-standard projection, since you use a custom built js-function to project latitudes and longitudes. Unless this projection is actually something that Proj4js can handle, you can not use Proj4Leaflet for this task. Instead, you would have to implement your own L.Projection and possibly also L.CRS.
However, if the projection you use actually does map to some well known projection, possibly with an EPSG code, the code looks about right.
Regarding what coordinates to use, there is a simple rule: Leaflet's API always uses WGS84 (L.LatLng). You only deal with the projected coordinates when setting up Proj4Leaflet, or if you happen to get projected coordinates from some other source.
Wow, thanks for the amazing explanation! This helped me to figure out that we use an exotic projection (only used internally I was told) that cannot be properly handled by the Proj4js library. I will try to delve into making our own L.Projection and/or CRS.
Hi,
Recently I started developing a Leaflet mapviewer for use in a mobile application. I am using my company's own tileserver and custom projection, so I tried implementing Proj4Leaflet's CRS with TMS.
However, I can't seem to get my projection working properly. I'm a bit confused as to which type of coordinate I need to pass for the projection settings. We have our own type of coordinates that are roughly 1 meter per coordinate, which we can convert to WGS84 and back via a complicated js method. I am a pretty big GIS newbie, so I don't immediately know if I should use my own coordinates or WGS84 in for example the 'center' property.
Could you maybe help me understand what I am doing wrong? If this is the wrong place to ask these questions, please say so and I'll try it on Stackoverflow or similar. Here is a redacted version of my code: