在Firebase中处理地理编码? [英] Handling geocoding in Firebase?

查看:168
本文介绍了在Firebase中处理地理编码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人尝试在Firebase中存储和/或搜索地理编码(例如lat / long)?这是内置于MongoDB中的功能,因为我正考虑将Firebase用于我们的后端,我需要知道如何在Firebase中处理这种情况。



感谢!

Firebase 最近开源了一个库,允许您在Firebase中存储和查询位置数据。总之,这很容易实现,因为Firebase中的所有键都是字符串,并且Firebase支持 startAt() endAt()查询,允许您为地理加密和边界框做适当的窗口。



有关实现细节和用法,请查看现场演示源代码和他们的博客文章 GeoFire。


Has anyone tried storing and/or searching on geocodes (e.g. lat/long) in Firebase? This is functionality that is built into MongoDB and as I'm considering using Firebase for our backend instead, I need to know how I'd handle this scenario in Firebase.

Thanks!

解决方案

The folks at Firebase recently open-sourced a library that allows you to store and query location data in Firebase. In short, this is very easily accomplished because all keys in Firebase are strings, and Firebase has support for startAt() and endAt() queries that allow you to do the appropriate windowing for geohashes and bounding boxes.

For implementation details and usage, check out the live demos, source code, and their blog post on GeoFire.

这篇关于在Firebase中处理地理编码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆