Skip to content

Commit 1a9fcc4

Browse files
committed
Fix for Flyio deploy
1 parent ddff5e2 commit 1a9fcc4

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

fullstack/assets/js/app.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ import Map from "./map";
2828

2929
let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content")
3030
let hooks = {
31-
Map
32-
//LiveToast: createLiveToastHook(),
31+
Map,
32+
LiveToast: createLiveToastHook(),
3333
} //{ VegaLite }
3434
let liveSocket = new LiveSocket("/live", Socket, { params: { _csrf_token: csrfToken }, hooks })
3535

fullstack/assets/js/map.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import maplibregl from "maplibre-gl";
1+
// Using global on template for Flyio deploy
2+
// import maplibregl from "maplibre-gl";
23
const Map = {
34
mounted() {
45
this.props = { id: this.el.getAttribute("data-id") };

fullstack/config/config.exs

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ config :esbuild,
4141
version: "0.17.11",
4242
default: [
4343
args:
44-
~w(js/app.js --bundle --target=es2017 --outdir=../priv/static/assets --external:/fonts/* --external:/images/* --external:vega-embed --external:maplibre-g),
44+
~w(js/app.js --bundle --target=es2017 --outdir=../priv/static/assets --external:/fonts/* --external:/images/* --external:vega-embed --external:maplibre-gl),
4545
cd: Path.expand("../assets", __DIR__),
4646
env: %{"NODE_PATH" => Path.expand("../deps", __DIR__)}
4747
]

fullstack/lib/fullstack_web/components/map_component.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ defmodule FullstackWeb.Live.MapComponent do
22
use FullstackWeb, :live_component
33
alias MapLibre
44

5-
@fill_colour "#ffa8db"
5+
@fill_colour "#03fc98"
66

77
def render(assigns) do
88
~H"""

fullstack/lib/fullstack_web/live/public/devices.ex

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ defmodule FullstackWeb.Public.DevicesLive.Index do
1515

1616
def render(assigns) do
1717
~H"""
18+
<link href='https://unpkg.com/maplibre-gl@3.6.2/dist/maplibre-gl.css' rel='stylesheet' />
19+
<script src='https://unpkg.com/maplibre-gl@3.6.2/dist/maplibre-gl.js'></script>
1820
<h1>Devices</h1>
1921
<div :if={@devices.loading}>Loading devices...</div>
2022
<div :if={devices = @devices.ok? && @devices.result}>

0 commit comments

Comments
 (0)