New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Indoor Maps - See Issue #675 #676
Conversation
* Adding cartesian crs * Adding identify projection * Cleaning up crs unbounded handling This is a potential solution for https://github.com/CloudMade/Leaflet/issues/675.
Thanks! I'm doing some refactoring of the projection code now, I'll look into merging this pull after this. |
@cfis it would be really helpful if you could provide a simple example/demo. Thanks for your effort. |
Sure, we have lots of live maps. Here is simple one: http://myfamecon.zerista.com/viewer/2799?facet_id=14 Here is a complicated one: http://iddba.zerista.com/viewer/3022 If you put "m." in front of the host name, you can also see the mobile version: |
Any hopes on getting this pull request in? Support for indoor maps is a great option. |
@krisbulman sure, see my earlier comment. I'll get to this pretty soon. |
Thanks for the update, seeing as it was over a month ago, i thought it may have got lost in the fray. |
@@ -0,0 +1,28 @@ | |||
/* | |||
* CRS.Cartesian is used for infinite coordinate systems that are not related to the Earth. Examples | |||
* include indoor maps, gaming maps, etc. We assume 0,0 is in the bottom right corner. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean bottom left here? From code it seems that only latitude is inverted, but longitude is still from left to right.
Yes, bottom left is what I meant. As for the falseEasting and falseNorthing, they provide a x an y offset for all points in the coordinate system. In our case we need this because sometimes we get data for indoor maps where the bottom left isn't 0,0 but is instead some random numbers pulled from a CAD system. For example, say we get a CAD drawing of a tradeshow floor where the bottom left booth might be at 100,100 and the top right booth at 200,200. We'd apply a false east of 100,100 so that the mapped booths take up the whole map area. I convert to percentages because that seemed to fit best into how leaflet already works. I took a look at the transformations that were being used in the various CRS's and they were all expressed as percentages. For example, EPSG3395: return new L.Transformation(0.5 / (Math.PI * r), 0.5, -0.5 / (Math.PI * r2), 0.5); Thus I just went down the same route. While on the subject of indoor maps, having to use LatLng objects to represent points in a cartesian coordinate system is pretty hacky feeling. What would be better in my view would be having a Point object which has an associated coordinate system with it. The interpretation of the point is then dependent on the coordinate system. That obviously is a much bigger change so I din't do it, but something for you to consider. Hope these answers make sense - ping me if you have more questions. |
Probably instead of falseEasting it better to add offset: new L.Point(0, 0) like in Icon? |
Sorry, been out last week. Yes, I'm fine with that. Want me to update the patch or will add that? |
Hi, how do I use this? I added it to my source and built it and now should I do: ? Thanks! |
Hi there, Ok I tried to integrate this into the latest version of LeafletJS but zoom does not work. Here is my github repository I don't understand what the unbounded stuff is so I mostly left it out. Would appreciate very much if someone can get the zoom working. Thanks, Philip |
Right, I remember this issue. The problem is the latlng class is wrapping when it shouldn't be. I updated LatLngBounds like this: getCenter: function (unbounded) /-> LatLng/ { Notice it now honors the unbounded parameter. I'd have to go back and verify if you have to change the calling sites, but don't see anything in my git log that shows that. |
@cfis I removed the unbounded parameter from the Map code in master, now you need to just pass |
Ok, sounds good. Are you still interested in merging these changes? Do you want me to update them first? |
@cfis I'm not yet done with rethinking/refactoring of projection code so I'll keep this open for a while. No need to update yet. |
Postponed to 0.5, see https://github.com/CloudMade/Leaflet/issues/210#issuecomment-7245887 |
What's the status of this patch? Is this still required to use this to display indoor maps? |
There were improvements in this regards in Leaflet 0.5 (see changelog), making flat maps easier, so I guess it's safe to close this. |
This commit adds in support for indoor maps by:
This is a potential solution for https://github.com/CloudMade/Leaflet/issues/675.