Comments (5)
@vbezruchkin No problem, I understand. At this time automatically applying default values from configs is not something I am considering, as I believe it to be out of the scope of this package.
Thanks for bringing this up, though! :)
from nova-map-marker-field.
Is this not what you mean?https://github.com/GeneaLabs/nova-map-marker-field#default-settings
from nova-map-marker-field.
No, I've seen that. But I guess I need to setup this every time I create a field, right?
I might have 10 map fields in different Nova resources. I'd like to have ONE common default settings rather configure default values every time I create a new field. It's like your default 12, and 0/0 for coordinates.
Thanks
from nova-map-marker-field.
I see. You can do this yourself already. Set up a config file, lets say config\settings.php
:
return [
"map_defaults" => [
"latitude" => "xxxxxxx",
"longitude" => "xxxxxxx",
"zoom" => 5,
],
];
Then in your nova resources:
MapMarker::make("Location")
->defaultZoom(config("settings.map_defaults.zoom"))
->defaultLatitude(config("settings.map_defaults.latitude"))
->defaultLongitude(config("settings.map_defaults.longitude")),
Those kind of things are very app-dependent, so it's best you handle that as you see fit. I don't want to impose any kind of convention like that, as I have already exposed the functions necessary to let people do what they want. :)
Let me know how that works.
from nova-map-marker-field.
Thanks for the advice. Yes, this seems reasonable, and I thought of it. But I'd like to go even further.
Let's say we have config file config\mapmarker.php
with the following content:
return [
"map_defaults" => [
"latitude" => "xxxxxxx",
"longitude" => "xxxxxxx",
"zoom" => 5,
],
];
and when I create a new Nova field, these settings would be applied automatically for all the resources. This would allow to get rid of default duplication in each resource:
MapMarker::make("Location"),
Not a big deal though, of course I can live with default values in several resource files. But in my case it would be easier to have ONE global settings file, without setting default values in each resource separately.
from nova-map-marker-field.
Related Issues (20)
- Is it possible to put several markers in a map ? HOT 2
- TypeError: Cannot create property 'latitude' on string HOT 5
- the mab is showing as balnk
- Better nullable support HOT 2
- Laravel 6 support on 0.2.2 HOT 1
- Nova is required for? HOT 1
- Google search provider does not work HOT 2
- Support for Storing lat/long in mysql Geo Point field HOT 9
- Map doesn't refresh on second search try. HOT 4
- Can't input in the search bar in Safari HOT 1
- CORS error HOT 1
- The pin icons needs to be rendered via the asset()/mix() func
- parsing failed bad endian byte value 50
- Laravel 9 support HOT 4
- Add a maxZoom param to l-tile-layer? HOT 1
- Nova 4 support HOT 2
- Please remove illuminate/support from dependencies. HOT 1
- Detail View bug with negative latitude and longitude HOT 1
- Not able to install the package due to illuminate/support HOT 2
- I'm on Laravel 9^ but I still am not able to install this package HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nova-map-marker-field.