Zend Framework 2 - Doctrine 2 - How to use GeoPoin

2019-09-02 06:42发布

I need to implement a GeoPointField with Doctrine2.

It seems that Zend and Doctrine don't support it natively...

Is there a best practice for validating such an input? In the database I'd use a simple string field, right?

1条回答
干净又极端
2楼-- · 2019-09-02 07:09
/^(\-?\d+(?:\.\d+)?),?\s*(\-?\d+(?:\.\d+)?)$/

This regexp validates and captures GEO input:

  • Latitude, Longitude
  • Latitude Longitude
  • Coords copied directly from GoogleMaps
查看更多
登录 后发表回答