Closed ryangurn closed 2 years ago
hi @ryangurn, awesome suggestion!
you can pass in a style or class attribute which will be used for the map, as seen here: https://github.com/LarsWiegers/laravel-maps/blob/master/resources/views/components/google.blade.php#:~:text=%3Cdiv%20id%3D%22%7B%7B%24mapId,%3E%3C/div%3E
let me know if that is not enough for your needs.
I have tried to pass style and it works but I want to customize it more than just the styles and its much easier when the views are published out to the resources/vendor/...
directory.
@LarsWiegers are you open to publishing the views out?
I dont currently know enough about publishing views and what that would mean for future version of that file to say yes to this right now. I will have to do some research into it.
@LarsWiegers the link in my initial post to this thread acts as a good start. let me know if there is anything you need to understand view publishing!
i added a comment to the pr, if you change that I can merge it
thanks for merging it in!
@ryangurn thanks for the pr for it!
I really love this package as it has made the process of displaying maps and coordinates super easy.
Thank you so much for putting in the time to build this!
I do have one request for improving the functionality. Currently on both map types you are essentially hardcoding in the height which is making it a bit more difficult to use with css frameworks such as bootstrap and tailwindcss.
This would be something that I could easily change if the views were published out in the same way that the config file is.
Would you consider changing uncommenting the following lines in
LaravelMapsServiceProvider.php
I have done a bit of digging in Laravel's package development documentation and noticed that when using
$this->loadViewsFrom
it will look in two places. The first of which is the views folder within the package and the second is theviews/vendor
folder within the resources directory.This would allow any other developers to make minor changes to the view without much effort.
Here is the documentation that I was reading by the way.
https://laravel.com/docs/9.x/packages#overriding-package-views
If you would like I can also test this and submit a PR if you would like, please just let me know in the comments on this issue and I can help as needed.