bluehalo / ngx-leaflet

Core Leaflet package for Angular.io
MIT License
776 stars 127 forks source link

How to use pixel dimensions instead of latLng #90

Closed razfazz closed 6 years ago

razfazz commented 7 years ago

I wrote a tileserver which serves a huge image in tiles in different zoom levels. I is possible switch leaflet to pixel mode in this plugin?

AndreasSchmid1 commented 7 years ago

would be nice to access the containerPointToLatLng() method before onmapready to set it in the mapped latlng in the options

reblace commented 7 years ago

containerPointToLatLng() hangs off of the map object, right?

The onMapReady function is called immediately after the map object is instantiated, so presumably you could call that method and then bind to the layers array.

I'm not really familiar with "pixel mode", so if you could give me an example of how you would make it work independent of the plugin, I could probably show you how to make it work with the plugin.

razfazz commented 7 years ago

I think the onMapReady and the map.unproject method was exactly what i wanted. Plus we need to set CRS.Simple

reblace commented 6 years ago

Ok, I'm gonna close this as resolved. If you have other issues, feel free to open another issue.

razfazz commented 6 years ago

Ok yes. I think it can be closed after map project and unproject does the transformation. But I was not able to set crs: L.CRS.Simple described in http://leafletjs.com/examples/crs-simple/crs-simple.html. Is there a way to do it with your plugin?

mcurtis22 commented 6 years ago

You can set the CRS in the leafletOptions object that is passed to the directive.

PixelPerfectJenna commented 10 months ago

@razfazz Were you able to set the map to pixel mode and then define the map bounds?