Closed mottab closed 6 years ago
const changeOrigin = (coords) => [coords[0] - 55, coords[1] - 25]
rc.unproject(changeOrigin(coords))
@commenthol Thanks, it seems simple but I am still can't get it. Let me explain more, I have an array of markers' locations and I also have an image that will appear using your library. This image shows another place of the world.
For example: The image location is between latlng(a, b), and latlng(c, d). and I have an array of locations for markers to put them on the image. The problem happens when I try to translate these locations to appear in the image.
Should I make this using the changeOrigin method you passed? If yes, unproject is used only for points, and I have locations, should I call project first and then unproject using the changeOrigin function?
Thanks
In other words, can I fit the raster-image to a specific place in the world?
This project maps flat images to its own flat world. The pixel coordinates used with project() and unproject() have no relation to WGS84 coordinates.
Hi,
Thank you very much, this is a helpful library to make really cool apps.
I need to change the starting point of the image so that when I call
project
orunproject
, it just converts the values regarding a specific location on the map.for example:
Now when I
unproject
a pointpoint [0, 0]
I got the following pointLatLng {lat: 85.0511287798066, lng: -180}
how can I customize this starting point let's say to[55, 25]
Thanks in advance