OrchardCMS / OrchardCore

Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
https://orchardcore.net
BSD 3-Clause "New" or "Revised" License
7.35k stars 2.37k forks source link

Input controls for Geo Point field #12744

Open scottiemc7 opened 1 year ago

scottiemc7 commented 1 year ago

Describe the bug

I use AWS location services to translate zip codes to lat/long whenever I create a specific content item. The lat/long returned are doubles. I store the values in a Geo Point field in the content item. It works great. However, when I try to update a content item I get a validation error on the Geo Point spinners (screenshot). Can we increase the precision on these inputs? Right now I'm having to trim off the last digit.

To Reproduce

Steps to reproduce the behavior:

  1. Create a content item with a geo point field
  2. Try to add a lat/long value with precision greater than 6

Screenshots

Screen Shot 2022-10-31 at 9 00 02 AM
Skrypt commented 1 year ago

Unless you are doing precision work having more than 6 digits is pretty much irrelevant. Though, we fixed the values to 6 digits for a reason back then. I think it was related to the Leaflet.js component.

scottiemc7 commented 1 year ago

Very interesting. Sounds like it's working as intended. For someone wanting that type of precision, would you suggest they create a custom content part? Or would an option to set the Geo Point precision level be helpful?

Skrypt commented 1 year ago

The issue is that we would need to fix the Leaflet integration to support more than 6 digits if we do so. You are welcome to try and fix this but it definitely needs to work with the Leaflet integration. Custom content part only if you want to use a workaround.

sebastienros commented 1 year ago

You can create custom Editors for any field, and then select it in the settings. That would be a great a ddition.

nerd3717 commented 1 year ago

I am using this field. But Why it's not exist in GraphQL UI ? When I request "render" I see that position field exist image

sebastienros commented 1 year ago

@nerd3717 it probably needs some custom code to integrate in GraphQL, please send a PR by looking at what other fields do (The closest should be NumericField).