Skip to content

Commit

Permalink
simplify name
Browse files Browse the repository at this point in the history
  • Loading branch information
Max committed Aug 8, 2022
1 parent 00172dc commit 786f18e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 26 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ return [
```

```php
use Elbgoods\NovaMapboxMarkerField\NovaMapboxMarkerField;
use Elbgoods\NovaMapboxMarkerField\MapboxMarkerField;

public function fields(Request $request)
{
return [
NovaMapboxMarkerField::make('Marker')
MapboxMarkerField::make('Marker')
->longitude($this->longitude)
->latitude($this->latitude)
->zoom(8),
Expand Down
26 changes: 3 additions & 23 deletions resources/js/components/DetailField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,7 @@ export default {
props: ['index', 'resource', 'resourceName', 'resourceId', 'field'],
data() {
return {
map: null,
draw: null,
geoJsonSource: {
type: "geojson",
data: {
type: "Feature",
geometry: this.field.geoJson,
}
}
map: null
};
},
mounted() {
Expand All @@ -44,20 +36,8 @@ export default {
showCompass: false
}), 'top-left');
// marker
this.map.on('load', () => {
// shape
this.map.addSource('layer', this.geoJsonSource)
this.map.addLayer({
id: 'layer',
type: 'fill',
source: 'layer',
layout: {},
paint: {
'fill-color': '#0080ff', // blue color fill
'fill-opacity': 0.5
}
});
// marker
new mapboxgl.Marker()
.setLngLat([longitude, latitude])
.addTo(this.map);
Expand All @@ -69,6 +49,6 @@ export default {
@import "~mapbox-gl/dist/mapbox-gl.css";
#mapContainer {
height: 450px;
height: 480px;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Laravel\Nova\Fields\Field;

class NovaMapboxMarkerField extends Field
class MapboxMarkerField extends Field
{
public $component = 'nova-mapbox-marker-field';

Expand Down

0 comments on commit 786f18e

Please sign in to comment.