feat: initial commit
This commit is contained in:
69
.build/Build.fs
Normal file
69
.build/Build.fs
Normal file
@@ -0,0 +1,69 @@
|
||||
open Fake.Core
|
||||
open Fake.IO
|
||||
open Farmer
|
||||
open Farmer.Builders
|
||||
|
||||
open Helpers
|
||||
|
||||
initializeContext()
|
||||
|
||||
let srcPath = Path.getFullName "src"
|
||||
let testPath = Path.getFullName "test"
|
||||
let libPath = Some srcPath
|
||||
|
||||
let deployPath = Path.getFullName "deploy"
|
||||
let packPath = Path.getFullName "packages"
|
||||
let versionFile = Path.getFullName ".version"
|
||||
|
||||
Target.create "Clean" (fun _ -> Shell.cleanDir deployPath)
|
||||
|
||||
Target.create "InstallClient" (fun _ ->
|
||||
run npm "install" "."
|
||||
run dotnet "tool restore" "."
|
||||
)
|
||||
|
||||
Target.create "Bundle" (fun _ ->
|
||||
run dotnet $"publish -c Release -o \"{deployPath}\"" srcPath
|
||||
)
|
||||
|
||||
Target.create "BundleDebug" (fun _ ->
|
||||
run dotnet $"publish -c Debug -o \"{deployPath}\"" srcPath
|
||||
)
|
||||
|
||||
Target.create "Pack" (fun _ ->
|
||||
match libPath with
|
||||
| Some p -> run dotnet $"pack -c Release -o \"{packPath}\"" p
|
||||
| None -> ()
|
||||
)
|
||||
|
||||
|
||||
Target.create "Format" (fun _ ->
|
||||
run dotnet "fantomas . -r" "src"
|
||||
)
|
||||
|
||||
Target.create "Test" (fun _ ->
|
||||
if System.IO.Directory.Exists testPath then
|
||||
run dotnet "run" testPath
|
||||
else ()
|
||||
)
|
||||
|
||||
open Fake.Core.TargetOperators
|
||||
|
||||
let dependencies = [
|
||||
"Clean"
|
||||
==> "InstallClient"
|
||||
==> "Bundle"
|
||||
|
||||
"Clean"
|
||||
==> "BundleDebug"
|
||||
|
||||
"Clean"
|
||||
==> "Test"
|
||||
|
||||
|
||||
"Clean"
|
||||
==> "Pack"
|
||||
]
|
||||
|
||||
[<EntryPoint>]
|
||||
let main args = runOrDefault args
|
||||
105
.build/Helpers.fs
Normal file
105
.build/Helpers.fs
Normal file
@@ -0,0 +1,105 @@
|
||||
module Helpers
|
||||
|
||||
open Fake.Core
|
||||
|
||||
let initializeContext () =
|
||||
let execContext = Context.FakeExecutionContext.Create false "build.fsx" [ ]
|
||||
Context.setExecutionContext (Context.RuntimeContext.Fake execContext)
|
||||
|
||||
module Proc =
|
||||
module Parallel =
|
||||
open System
|
||||
|
||||
let locker = obj()
|
||||
|
||||
let colors =
|
||||
[| ConsoleColor.Blue
|
||||
ConsoleColor.Yellow
|
||||
ConsoleColor.Magenta
|
||||
ConsoleColor.Cyan
|
||||
ConsoleColor.DarkBlue
|
||||
ConsoleColor.DarkYellow
|
||||
ConsoleColor.DarkMagenta
|
||||
ConsoleColor.DarkCyan |]
|
||||
|
||||
let print color (colored: string) (line: string) =
|
||||
lock locker
|
||||
(fun () ->
|
||||
let currentColor = Console.ForegroundColor
|
||||
Console.ForegroundColor <- color
|
||||
Console.Write colored
|
||||
Console.ForegroundColor <- currentColor
|
||||
Console.WriteLine line)
|
||||
|
||||
let onStdout index name (line: string) =
|
||||
let color = colors.[index % colors.Length]
|
||||
if isNull line then
|
||||
print color $"{name}: --- END ---" ""
|
||||
else if String.isNotNullOrEmpty line then
|
||||
print color $"{name}: " line
|
||||
|
||||
let onStderr name (line: string) =
|
||||
let color = ConsoleColor.Red
|
||||
if isNull line |> not then
|
||||
print color $"{name}: " line
|
||||
|
||||
let redirect (index, (name, createProcess)) =
|
||||
createProcess
|
||||
|> CreateProcess.redirectOutputIfNotRedirected
|
||||
|> CreateProcess.withOutputEvents (onStdout index name) (onStderr name)
|
||||
|
||||
let printStarting indexed =
|
||||
for (index, (name, c: CreateProcess<_>)) in indexed do
|
||||
let color = colors.[index % colors.Length]
|
||||
let wd =
|
||||
c.WorkingDirectory
|
||||
|> Option.defaultValue ""
|
||||
let exe = c.Command.Executable
|
||||
let args = c.Command.Arguments.ToStartInfo
|
||||
print color $"{name}: {wd}> {exe} {args}" ""
|
||||
|
||||
let run cs =
|
||||
cs
|
||||
|> Seq.toArray
|
||||
|> Array.indexed
|
||||
|> fun x -> printStarting x; x
|
||||
|> Array.map redirect
|
||||
|> Array.Parallel.map Proc.run
|
||||
|
||||
let createProcess exe arg dir =
|
||||
CreateProcess.fromRawCommandLine exe arg
|
||||
|> CreateProcess.withWorkingDirectory dir
|
||||
|> CreateProcess.ensureExitCode
|
||||
|
||||
let dotnet = createProcess "dotnet"
|
||||
let npm =
|
||||
let npmPath =
|
||||
match ProcessUtils.tryFindFileOnPath "npm" with
|
||||
| Some path -> path
|
||||
| None ->
|
||||
"npm was not found in path. Please install it and make sure it's available from your path. " +
|
||||
"See https://safe-stack.github.io/docs/quickstart/#install-pre-requisites for more info"
|
||||
|> failwith
|
||||
|
||||
createProcess npmPath
|
||||
|
||||
let run proc arg dir =
|
||||
proc arg dir
|
||||
|> Proc.run
|
||||
|> ignore
|
||||
|
||||
let runParallel processes =
|
||||
processes
|
||||
|> Proc.Parallel.run
|
||||
|> ignore
|
||||
|
||||
let runOrDefault args =
|
||||
try
|
||||
match args with
|
||||
| [| target |] -> Target.runOrDefault target
|
||||
| _ ->
|
||||
Target.runOrDefault "Pack"
|
||||
0
|
||||
with e ->
|
||||
printfn "%A" e
|
||||
1
|
||||
18
.config/dotnet-tools.json
Normal file
18
.config/dotnet-tools.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"version": 1,
|
||||
"isRoot": true,
|
||||
"tools": {
|
||||
"fable": {
|
||||
"version": "3.7.0",
|
||||
"commands": [
|
||||
"fable"
|
||||
]
|
||||
},
|
||||
"fantomas-tool": {
|
||||
"version": "4.6.4",
|
||||
"commands": [
|
||||
"fantomas"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
29
.devcontainer/Dockerfile
Normal file
29
.devcontainer/Dockerfile
Normal file
@@ -0,0 +1,29 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:6.0
|
||||
|
||||
# Add keys and sources lists
|
||||
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash
|
||||
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
|
||||
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" \
|
||||
| tee /etc/apt/sources.list.d/yarn.list
|
||||
|
||||
# Install node, 7zip, yarn, git, process tools
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y nodejs p7zip-full git procps ssh-client
|
||||
|
||||
# Clean up
|
||||
RUN apt-get autoremove -y \
|
||||
&& apt-get clean -y \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install dotnet tools
|
||||
RUN dotnet tool install fable -g
|
||||
|
||||
# Trouble brewing
|
||||
RUN rm /etc/ssl/openssl.cnf
|
||||
|
||||
# add dotnet tools to path to pick up fake and paket installation
|
||||
ENV PATH="/root/.dotnet/tools:${PATH}"
|
||||
|
||||
# Copy endpoint specific user settings into container to specify
|
||||
# .NET Core should be used as the runtime.
|
||||
COPY settings.vscode.json /root/.vscode-remote/data/Machine/settings.json
|
||||
11
.devcontainer/devcontainer.json
Normal file
11
.devcontainer/devcontainer.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "SAFE",
|
||||
"dockerFile": "Dockerfile",
|
||||
"appPort": [8080, 8085],
|
||||
"extensions": [
|
||||
"ionide.ionide-fsharp",
|
||||
"ms-dotnettools.csharp",
|
||||
"editorconfig.editorconfig",
|
||||
"msjsdiag.debugger-for-chrome"
|
||||
]
|
||||
}
|
||||
3
.devcontainer/settings.vscode.json
Normal file
3
.devcontainer/settings.vscode.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"FSharp.fsacRuntime":"netcore"
|
||||
}
|
||||
32
.editorconfig
Normal file
32
.editorconfig
Normal file
@@ -0,0 +1,32 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = false
|
||||
|
||||
[*.fs]
|
||||
max_line_length=120
|
||||
# Feliz style
|
||||
fsharp_single_argument_web_mode=true
|
||||
fsharp_space_before_colon=false
|
||||
fsharp_max_if_then_else_short_width=60
|
||||
fsharp_max_infix_operator_expression=50
|
||||
fsharp_max_record_width=70
|
||||
fsharp_max_record_number_of_items=1
|
||||
fsharp_max_array_or_list_width=70
|
||||
fsharp_max_array_or_list_number_of_items=1
|
||||
fsharp_max_value_binding_width=70
|
||||
fsharp_max_function_binding_width=40
|
||||
fsharp_max_dot_get_expression_width=50
|
||||
fsharp_multiline_block_brackets_on_same_column=true
|
||||
fsharp_newline_between_type_definition_and_members=false
|
||||
fsharp_max_elmish_width=40
|
||||
fsharp_align_function_signature_to_indentation=false
|
||||
fsharp_alternative_long_member_definitions=false
|
||||
fsharp_multi_line_lambda_closing_newline=false
|
||||
fsharp_disable_elmish_syntax=false
|
||||
fsharp_keep_indent_in_branch=false
|
||||
fsharp_blank_lines_around_nested_multiline_expressions=false
|
||||
17
.gitignore
vendored
Normal file
17
.gitignore
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
.fable/
|
||||
.fake/
|
||||
.vs/
|
||||
obj/
|
||||
bin/
|
||||
packages/
|
||||
node_modules/
|
||||
src/Client/public/js/
|
||||
release.cmd
|
||||
release.sh
|
||||
.idea/
|
||||
*.orig
|
||||
*.DotSettings.user
|
||||
deploy
|
||||
.ionide/
|
||||
*.db
|
||||
build.fsx.lock
|
||||
9
.gitlab-ci.yml
Normal file
9
.gitlab-ci.yml
Normal file
@@ -0,0 +1,9 @@
|
||||
variables:
|
||||
DEPLOY_NAME: default
|
||||
DEPLOY_NAMESPACE: default
|
||||
|
||||
include:
|
||||
- project: oceanbox/gitlab-ci
|
||||
ref: main
|
||||
file: DotnetPackage.gitlab-ci.yml
|
||||
|
||||
41
.releaserc.yaml
Normal file
41
.releaserc.yaml
Normal file
@@ -0,0 +1,41 @@
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
- name: develop
|
||||
prerelease: true
|
||||
|
||||
plugins:
|
||||
- '@semantic-release/commit-analyzer'
|
||||
- '@semantic-release/release-notes-generator'
|
||||
- - '@semantic-release/changelog'
|
||||
- changelogFile: RELEASE_NOTES.md
|
||||
changelogTitle: "# Changelog"
|
||||
- - 'semantic-release-dotnet'
|
||||
- paths: [ "src/*.fsproj", "src/*/*.fsproj" ]
|
||||
- - '@semantic-release/exec'
|
||||
- generateNotesCmd: "echo ${nextRelease.version} > .version"
|
||||
- - '@semantic-release/git'
|
||||
- message: "chore(release): ${nextRelease.version}\n\n${nextRelease.notes}"
|
||||
assets: [ "RELEASE_NOTES.md", ".version", "src/*.fsproj", "src/*/*.fsproj" ]
|
||||
- - '@semantic-release/gitlab'
|
||||
- assets: []
|
||||
|
||||
analyzeCommits:
|
||||
- path: "@semantic-release/commit-analyzer"
|
||||
releaseRules:
|
||||
- type: "fix"
|
||||
release: "patch"
|
||||
- type: "patch"
|
||||
release: "patch"
|
||||
- type: "feat"
|
||||
release: "minor"
|
||||
- type: "feature"
|
||||
release: "minor"
|
||||
- type: "minor"
|
||||
release: "minor"
|
||||
- type: "breaking"
|
||||
release: "major"
|
||||
- type: "major"
|
||||
release: "major"
|
||||
|
||||
|
||||
16
Build.fsproj
Normal file
16
Build.fsproj
Normal file
@@ -0,0 +1,16 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include=".build/Helpers.fs" />
|
||||
<Compile Include=".build/Build.fs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Fake.Core.Target" Version="5.20.4" />
|
||||
<PackageReference Include="Fake.DotNet.Cli" Version="5.20.4" />
|
||||
<PackageReference Include="Fake.IO.FileSystem" Version="5.20.4" />
|
||||
<PackageReference Include="Farmer" Version="1.6.26" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
77
Fable.OpenLayers.sln
Normal file
77
Fable.OpenLayers.sln
Normal file
@@ -0,0 +1,77 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.27004.2005
|
||||
MinimumVisualStudioVersion = 15.0.26124.0
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D939B1CF-478F-4A38-B306-AEB5292814C0}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
README.md = README.md
|
||||
LICENSE = LICENSE
|
||||
Dockerfile = Dockerfile
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Build", "Build.fsproj", "{66B2CD7E-27CC-4011-88BF-B09F1317555A}"
|
||||
EndProject
|
||||
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "src", "src/Fable.OpenLayers.fsproj", "{5B875512-A9C1-4F66-A880-E06351893933}"
|
||||
EndProject
|
||||
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "test", "test\Tests.fsproj", "{1DD5605F-15E8-4814-A51F-04858B3EDD7B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{66B2CD7E-27CC-4011-88BF-B09F1317555A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{66B2CD7E-27CC-4011-88BF-B09F1317555A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{66B2CD7E-27CC-4011-88BF-B09F1317555A}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{66B2CD7E-27CC-4011-88BF-B09F1317555A}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{66B2CD7E-27CC-4011-88BF-B09F1317555A}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{66B2CD7E-27CC-4011-88BF-B09F1317555A}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{66B2CD7E-27CC-4011-88BF-B09F1317555A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{66B2CD7E-27CC-4011-88BF-B09F1317555A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{66B2CD7E-27CC-4011-88BF-B09F1317555A}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{66B2CD7E-27CC-4011-88BF-B09F1317555A}.Release|x64.Build.0 = Release|Any CPU
|
||||
{66B2CD7E-27CC-4011-88BF-B09F1317555A}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{66B2CD7E-27CC-4011-88BF-B09F1317555A}.Release|x86.Build.0 = Release|Any CPU
|
||||
|
||||
{5B875512-A9C1-4F66-A880-E06351893933}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{5B875512-A9C1-4F66-A880-E06351893933}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{5B875512-A9C1-4F66-A880-E06351893933}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{5B875512-A9C1-4F66-A880-E06351893933}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{5B875512-A9C1-4F66-A880-E06351893933}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{5B875512-A9C1-4F66-A880-E06351893933}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{5B875512-A9C1-4F66-A880-E06351893933}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{5B875512-A9C1-4F66-A880-E06351893933}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{5B875512-A9C1-4F66-A880-E06351893933}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{5B875512-A9C1-4F66-A880-E06351893933}.Release|x64.Build.0 = Release|Any CPU
|
||||
{5B875512-A9C1-4F66-A880-E06351893933}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{5B875512-A9C1-4F66-A880-E06351893933}.Release|x86.Build.0 = Release|Any CPU
|
||||
|
||||
{1DD5605F-15E8-4814-A51F-04858B3EDD7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1DD5605F-15E8-4814-A51F-04858B3EDD7B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1DD5605F-15E8-4814-A51F-04858B3EDD7B}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{1DD5605F-15E8-4814-A51F-04858B3EDD7B}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{1DD5605F-15E8-4814-A51F-04858B3EDD7B}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{1DD5605F-15E8-4814-A51F-04858B3EDD7B}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{1DD5605F-15E8-4814-A51F-04858B3EDD7B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1DD5605F-15E8-4814-A51F-04858B3EDD7B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{1DD5605F-15E8-4814-A51F-04858B3EDD7B}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{1DD5605F-15E8-4814-A51F-04858B3EDD7B}.Release|x64.Build.0 = Release|Any CPU
|
||||
{1DD5605F-15E8-4814-A51F-04858B3EDD7B}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{1DD5605F-15E8-4814-A51F-04858B3EDD7B}.Release|x86.Build.0 = Release|Any CPU
|
||||
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {FDFC8500-74D4-4302-8ADC-D84EC240EEB9}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
21
LICENSE
Normal file
21
LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 Serit Tromsø AS
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
9
README.md
Normal file
9
README.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Fable.OpenLayers
|
||||
|
||||
## Run
|
||||
|
||||
`dotnet run`
|
||||
|
||||
## Build
|
||||
|
||||
`dotnet run Bundle`
|
||||
1
RELEASE_NOTES.md
Normal file
1
RELEASE_NOTES.md
Normal file
@@ -0,0 +1 @@
|
||||
# Changelog
|
||||
486
dist/Fable.OpenLayers.js
vendored
Normal file
486
dist/Fable.OpenLayers.js
vendored
Normal file
@@ -0,0 +1,486 @@
|
||||
import { Union, Record } from "./fable_modules/fable-library.3.7.0/Types.js";
|
||||
import { bool_type, tuple_type, lambda_type, unit_type, float64_type, obj_type, union_type, array_type, int32_type, class_type, record_type, string_type } from "./fable_modules/fable-library.3.7.0/Reflection.js";
|
||||
import { keyValueList } from "./fable_modules/fable-library.3.7.0/MapUtil.js";
|
||||
import Projection from "ol/proj/Projection";
|
||||
import GeoJSON from "ol/format/GeoJSON";
|
||||
import MVT from "ol/format/MVT";
|
||||
import Stroke from "ol/style/Stroke";
|
||||
import Style from "ol/style/Style";
|
||||
import TileGrid from "ol/tilegrid/TileGrid";
|
||||
import WMTS from "ol/tilegrid/WMTS";
|
||||
import Vector from "ol/source/Vector";
|
||||
import XYZ from "ol/source/XYZ";
|
||||
import VectorTile from "ol/source/VectorTile";
|
||||
import TileWMS from "ol/source/TileWMS";
|
||||
import WMTS_1 from "ol/source/WMTS";
|
||||
import Tile from "ol/layer/Tile";
|
||||
import Vector_1 from "ol/layer/Vector";
|
||||
import VectorTile_1 from "ol/layer/VectorTile";
|
||||
import { Map as Map$, View } from "ol";
|
||||
|
||||
export class Types_WMTSConfig extends Record {
|
||||
constructor(layer, matrixSet) {
|
||||
super();
|
||||
this.layer = layer;
|
||||
this.matrixSet = matrixSet;
|
||||
}
|
||||
}
|
||||
|
||||
export function Types_WMTSConfig$reflection() {
|
||||
return record_type("Fable.OpenLayers.Types.WMTSConfig", [], Types_WMTSConfig, () => [["layer", string_type], ["matrixSet", string_type]]);
|
||||
}
|
||||
|
||||
export class Ol {
|
||||
constructor() {
|
||||
}
|
||||
}
|
||||
|
||||
export function Ol$reflection() {
|
||||
return class_type("Fable.OpenLayers.Ol", void 0, Ol);
|
||||
}
|
||||
|
||||
export class Imports_Proj {
|
||||
constructor() {
|
||||
}
|
||||
}
|
||||
|
||||
export function Imports_Proj$reflection() {
|
||||
return class_type("Fable.OpenLayers.Imports.Proj", void 0, Imports_Proj);
|
||||
}
|
||||
|
||||
export class Imports_Style {
|
||||
constructor() {
|
||||
}
|
||||
}
|
||||
|
||||
export function Imports_Style$reflection() {
|
||||
return class_type("Fable.OpenLayers.Imports.Style", void 0, Imports_Style);
|
||||
}
|
||||
|
||||
export class Imports_Format {
|
||||
constructor() {
|
||||
}
|
||||
}
|
||||
|
||||
export function Imports_Format$reflection() {
|
||||
return class_type("Fable.OpenLayers.Imports.Format", void 0, Imports_Format);
|
||||
}
|
||||
|
||||
export class Imports_TileGrid {
|
||||
constructor() {
|
||||
}
|
||||
}
|
||||
|
||||
export function Imports_TileGrid$reflection() {
|
||||
return class_type("Fable.OpenLayers.Imports.TileGrid", void 0, Imports_TileGrid);
|
||||
}
|
||||
|
||||
export class Imports_Source {
|
||||
constructor() {
|
||||
}
|
||||
}
|
||||
|
||||
export function Imports_Source$reflection() {
|
||||
return class_type("Fable.OpenLayers.Imports.Source", void 0, Imports_Source);
|
||||
}
|
||||
|
||||
export class Imports_Layer {
|
||||
constructor() {
|
||||
}
|
||||
}
|
||||
|
||||
export function Imports_Layer$reflection() {
|
||||
return class_type("Fable.OpenLayers.Imports.Layer", void 0, Imports_Layer);
|
||||
}
|
||||
|
||||
export class Imports_Extent {
|
||||
constructor() {
|
||||
}
|
||||
}
|
||||
|
||||
export function Imports_Extent$reflection() {
|
||||
return class_type("Fable.OpenLayers.Imports.Extent", void 0, Imports_Extent);
|
||||
}
|
||||
|
||||
export class OlModule_Proj_ProjectionProps extends Union {
|
||||
constructor(tag, ...fields) {
|
||||
super();
|
||||
this.tag = (tag | 0);
|
||||
this.fields = fields;
|
||||
}
|
||||
cases() {
|
||||
return ["Code", "Unit", "Extent"];
|
||||
}
|
||||
}
|
||||
|
||||
export function OlModule_Proj_ProjectionProps$reflection() {
|
||||
return union_type("Fable.OpenLayers.OlModule.Proj.ProjectionProps", [], OlModule_Proj_ProjectionProps, () => [[["Item", string_type]], [["Item", string_type]], [["Item", array_type(array_type(int32_type))]]]);
|
||||
}
|
||||
|
||||
export function OlModule_Proj_projection(options) {
|
||||
const opts = keyValueList(options, 1);
|
||||
return new Projection(opts);
|
||||
}
|
||||
|
||||
export class OlModule_Format_GeoJSONProps extends Union {
|
||||
constructor(tag, ...fields) {
|
||||
super();
|
||||
this.tag = (tag | 0);
|
||||
this.fields = fields;
|
||||
}
|
||||
cases() {
|
||||
return ["DataProjection"];
|
||||
}
|
||||
}
|
||||
|
||||
export function OlModule_Format_GeoJSONProps$reflection() {
|
||||
return union_type("Fable.OpenLayers.OlModule.Format.GeoJSONProps", [], OlModule_Format_GeoJSONProps, () => [[["Item", class_type("Fable.OpenLayers.Interfaces.Proj.IProjection")]]]);
|
||||
}
|
||||
|
||||
export function OlModule_Format_geoJSON(options) {
|
||||
const opts = keyValueList(options, 1);
|
||||
return new GeoJSON(opts);
|
||||
}
|
||||
|
||||
export function OlModule_Format_mvt() {
|
||||
return new MVT();
|
||||
}
|
||||
|
||||
export class OlModule_Style_StyleProps extends Union {
|
||||
constructor(tag, ...fields) {
|
||||
super();
|
||||
this.tag = (tag | 0);
|
||||
this.fields = fields;
|
||||
}
|
||||
cases() {
|
||||
return ["Fill", "Stroke", "Text", "ZIndex", "Geometry", "Image", "Renderer"];
|
||||
}
|
||||
}
|
||||
|
||||
export function OlModule_Style_StyleProps$reflection() {
|
||||
return union_type("Fable.OpenLayers.OlModule.Style.StyleProps", [], OlModule_Style_StyleProps, () => [[["Item", class_type("Fable.OpenLayers.Interfaces.Style.IStyle")]], [["Item", class_type("Fable.OpenLayers.Interfaces.Style.IStyle")]], [["Item", class_type("Fable.OpenLayers.Interfaces.Style.IStyle")]], [["Item", int32_type]], [["Item", class_type("Fable.OpenLayers.Interfaces.Geom.IGeometry")]], [["Item", obj_type]], [["Item", obj_type]]]);
|
||||
}
|
||||
|
||||
export class OlModule_Style_StrokeProps extends Union {
|
||||
constructor(tag, ...fields) {
|
||||
super();
|
||||
this.tag = (tag | 0);
|
||||
this.fields = fields;
|
||||
}
|
||||
cases() {
|
||||
return ["Color", "Width", "LineCap", "LineDash"];
|
||||
}
|
||||
}
|
||||
|
||||
export function OlModule_Style_StrokeProps$reflection() {
|
||||
return union_type("Fable.OpenLayers.OlModule.Style.StrokeProps", [], OlModule_Style_StrokeProps, () => [[["Item", string_type]], [["Item", float64_type]], [["Item", string_type]], [["Item", array_type(float64_type)]]]);
|
||||
}
|
||||
|
||||
export class OlModule_Style_FillProps extends Union {
|
||||
constructor(tag, ...fields) {
|
||||
super();
|
||||
this.tag = (tag | 0);
|
||||
this.fields = fields;
|
||||
}
|
||||
cases() {
|
||||
return ["Color"];
|
||||
}
|
||||
}
|
||||
|
||||
export function OlModule_Style_FillProps$reflection() {
|
||||
return union_type("Fable.OpenLayers.OlModule.Style.FillProps", [], OlModule_Style_FillProps, () => [[["Item", string_type]]]);
|
||||
}
|
||||
|
||||
export class OlModule_Style_TextProps extends Union {
|
||||
constructor(tag, ...fields) {
|
||||
super();
|
||||
this.tag = (tag | 0);
|
||||
this.fields = fields;
|
||||
}
|
||||
cases() {
|
||||
return ["Text", "Align", "Fill", "Stroke", "BackgroundFill", "BackgroundStroke", "Font", "Scale", "Padding", "Rotation"];
|
||||
}
|
||||
}
|
||||
|
||||
export function OlModule_Style_TextProps$reflection() {
|
||||
return union_type("Fable.OpenLayers.OlModule.Style.TextProps", [], OlModule_Style_TextProps, () => [[["Item", string_type]], [["Item", string_type]], [["Item", class_type("Fable.OpenLayers.Interfaces.Style.IStyle")]], [["Item", class_type("Fable.OpenLayers.Interfaces.Style.IStyle")]], [["Item", class_type("Fable.OpenLayers.Interfaces.Style.IStyle")]], [["Item", class_type("Fable.OpenLayers.Interfaces.Style.IStyle")]], [["Item", string_type]], [["Item", float64_type]], [["Item", array_type(float64_type)]], [["Item", float64_type]]]);
|
||||
}
|
||||
|
||||
export function OlModule_Style_stroke(options) {
|
||||
const opts = keyValueList(options, 1);
|
||||
return new Stroke(opts);
|
||||
}
|
||||
|
||||
export function OlModule_Style_fill(options) {
|
||||
const opts = keyValueList(options, 1);
|
||||
return new Style(opts);
|
||||
}
|
||||
|
||||
export function OlModule_Style_style(options) {
|
||||
const opts = keyValueList(options, 1);
|
||||
return new Style(opts);
|
||||
}
|
||||
|
||||
export class OlModule_TileGrid_TileGridProps extends Union {
|
||||
constructor(tag, ...fields) {
|
||||
super();
|
||||
this.tag = (tag | 0);
|
||||
this.fields = fields;
|
||||
}
|
||||
cases() {
|
||||
return ["Extent", "Resolution", "MatrixIds"];
|
||||
}
|
||||
}
|
||||
|
||||
export function OlModule_TileGrid_TileGridProps$reflection() {
|
||||
return union_type("Fable.OpenLayers.OlModule.TileGrid.TileGridProps", [], OlModule_TileGrid_TileGridProps, () => [[["Item", array_type(float64_type)]], [["Item", array_type(float64_type)]], [["Item", array_type(float64_type)]]]);
|
||||
}
|
||||
|
||||
export class OlModule_TileGrid_WMTSProps extends Union {
|
||||
constructor(tag, ...fields) {
|
||||
super();
|
||||
this.tag = (tag | 0);
|
||||
this.fields = fields;
|
||||
}
|
||||
cases() {
|
||||
return ["Extent", "Resolution", "MatrixIds"];
|
||||
}
|
||||
}
|
||||
|
||||
export function OlModule_TileGrid_WMTSProps$reflection() {
|
||||
return union_type("Fable.OpenLayers.OlModule.TileGrid.WMTSProps", [], OlModule_TileGrid_WMTSProps, () => [[["Item", array_type(float64_type)]], [["Item", array_type(float64_type)]], [["Item", array_type(float64_type)]]]);
|
||||
}
|
||||
|
||||
export function OlModule_TileGrid_tileGrid(options) {
|
||||
const opts = keyValueList(options, 1);
|
||||
return new TileGrid(opts);
|
||||
}
|
||||
|
||||
export function OlModule_TileGrid_wmts(options) {
|
||||
const opts = keyValueList(options, 1);
|
||||
return new WMTS(opts);
|
||||
}
|
||||
|
||||
export class OlModule_Source_VectorProps extends Union {
|
||||
constructor(tag, ...fields) {
|
||||
super();
|
||||
this.tag = (tag | 0);
|
||||
this.fields = fields;
|
||||
}
|
||||
cases() {
|
||||
return ["Features"];
|
||||
}
|
||||
}
|
||||
|
||||
export function OlModule_Source_VectorProps$reflection() {
|
||||
return union_type("Fable.OpenLayers.OlModule.Source.VectorProps", [], OlModule_Source_VectorProps, () => [[["Item", class_type("Fable.OpenLayers.Interfaces.Format.IFormat")]]]);
|
||||
}
|
||||
|
||||
export class OlModule_Source_XYZProps extends Union {
|
||||
constructor(tag, ...fields) {
|
||||
super();
|
||||
this.tag = (tag | 0);
|
||||
this.fields = fields;
|
||||
}
|
||||
cases() {
|
||||
return ["Projection", "Url"];
|
||||
}
|
||||
}
|
||||
|
||||
export function OlModule_Source_XYZProps$reflection() {
|
||||
return union_type("Fable.OpenLayers.OlModule.Source.XYZProps", [], OlModule_Source_XYZProps, () => [[["Item", class_type("Fable.OpenLayers.Interfaces.Proj.IProjection")]], [["Item", string_type]]]);
|
||||
}
|
||||
|
||||
export class OlModule_Source_VectorTileProps extends Union {
|
||||
constructor(tag, ...fields) {
|
||||
super();
|
||||
this.tag = (tag | 0);
|
||||
this.fields = fields;
|
||||
}
|
||||
cases() {
|
||||
return ["TileLoadFunction", "TileUrlFunction", "Projection", "Format", "TileGrid", "TileSize", "Url", "TilePixelRatio"];
|
||||
}
|
||||
}
|
||||
|
||||
export function OlModule_Source_VectorTileProps$reflection() {
|
||||
return union_type("Fable.OpenLayers.OlModule.Source.VectorTileProps", [], OlModule_Source_VectorTileProps, () => [[["Item", lambda_type(class_type("Fable.OpenLayers.Interfaces.Tile.ITile"), lambda_type(string_type, unit_type))]], [["Item", lambda_type(tuple_type(array_type(int32_type), int32_type, class_type("Fable.OpenLayers.Interfaces.Proj.IProjection")), string_type)]], [["Item", class_type("Fable.OpenLayers.Interfaces.Proj.IProjection")]], [["Item", class_type("Fable.OpenLayers.Interfaces.Format.IFormat")]], [["Item", class_type("Fable.OpenLayers.Interfaces.TileGrid.ITileGrid")]], [["Item", int32_type]], [["Item", string_type]], [["Item", int32_type]]]);
|
||||
}
|
||||
|
||||
export class OlModule_Source_TileWMSProps extends Union {
|
||||
constructor(tag, ...fields) {
|
||||
super();
|
||||
this.tag = (tag | 0);
|
||||
this.fields = fields;
|
||||
}
|
||||
cases() {
|
||||
return ["Url", "Params", "ServerType", "Transition"];
|
||||
}
|
||||
}
|
||||
|
||||
export function OlModule_Source_TileWMSProps$reflection() {
|
||||
return union_type("Fable.OpenLayers.OlModule.Source.TileWMSProps", [], OlModule_Source_TileWMSProps, () => [[["Item", string_type]], [["Item", obj_type]], [["Item", string_type]], [["Item", string_type]]]);
|
||||
}
|
||||
|
||||
export class OlModule_Source_WMTSProps extends Union {
|
||||
constructor(tag, ...fields) {
|
||||
super();
|
||||
this.tag = (tag | 0);
|
||||
this.fields = fields;
|
||||
}
|
||||
cases() {
|
||||
return ["Url", "Layer", "Format", "Projection", "TileGrid", "WarpX", "Style"];
|
||||
}
|
||||
}
|
||||
|
||||
export function OlModule_Source_WMTSProps$reflection() {
|
||||
return union_type("Fable.OpenLayers.OlModule.Source.WMTSProps", [], OlModule_Source_WMTSProps, () => [[["Item", string_type]], [["Item", string_type]], [["Item", class_type("Fable.OpenLayers.Interfaces.Format.IFormat")]], [["Item", class_type("Fable.OpenLayers.Interfaces.Proj.IProjection")]], [["Item", class_type("Fable.OpenLayers.Interfaces.TileGrid.ITileGrid")]], [["Item", bool_type]], [["Item", class_type("Fable.OpenLayers.Interfaces.Style.IStyle")]]]);
|
||||
}
|
||||
|
||||
export function OlModule_Source_vector(options) {
|
||||
const opts = keyValueList(options, 1);
|
||||
return new Vector(opts);
|
||||
}
|
||||
|
||||
export function OlModule_Source_xyz(options) {
|
||||
const opts = keyValueList(options, 1);
|
||||
return new XYZ(opts);
|
||||
}
|
||||
|
||||
export function OlModule_Source_vectorTile(options) {
|
||||
const opts = keyValueList(options, 1);
|
||||
return new VectorTile(opts);
|
||||
}
|
||||
|
||||
export function OlModule_Source_tileWMS(options) {
|
||||
const opts = keyValueList(options, 1);
|
||||
return new TileWMS(opts);
|
||||
}
|
||||
|
||||
export function OlModule_Source_wmts(options) {
|
||||
const opts = keyValueList(options, 1);
|
||||
return new WMTS_1(opts);
|
||||
}
|
||||
|
||||
export class OlModule_Layer_VectorProps extends Union {
|
||||
constructor(tag, ...fields) {
|
||||
super();
|
||||
this.tag = (tag | 0);
|
||||
this.fields = fields;
|
||||
}
|
||||
cases() {
|
||||
return ["Source", "Style", "MinZoom"];
|
||||
}
|
||||
}
|
||||
|
||||
export function OlModule_Layer_VectorProps$reflection() {
|
||||
return union_type("Fable.OpenLayers.OlModule.Layer.VectorProps", [], OlModule_Layer_VectorProps, () => [[["Item", class_type("Fable.OpenLayers.Interfaces.Source.ISource")]], [["Item", class_type("Fable.OpenLayers.Interfaces.Style.IStyle")]], [["Item", int32_type]]]);
|
||||
}
|
||||
|
||||
export class OlModule_Layer_TileProps extends Union {
|
||||
constructor(tag, ...fields) {
|
||||
super();
|
||||
this.tag = (tag | 0);
|
||||
this.fields = fields;
|
||||
}
|
||||
cases() {
|
||||
return ["Source", "MinZoom"];
|
||||
}
|
||||
}
|
||||
|
||||
export function OlModule_Layer_TileProps$reflection() {
|
||||
return union_type("Fable.OpenLayers.OlModule.Layer.TileProps", [], OlModule_Layer_TileProps, () => [[["Item", class_type("Fable.OpenLayers.Interfaces.Source.ISource")]], [["Item", int32_type]]]);
|
||||
}
|
||||
|
||||
export class OlModule_Layer_VectorTileProps extends Union {
|
||||
constructor(tag, ...fields) {
|
||||
super();
|
||||
this.tag = (tag | 0);
|
||||
this.fields = fields;
|
||||
}
|
||||
cases() {
|
||||
return ["Source", "MinZoom", "TileGrid"];
|
||||
}
|
||||
}
|
||||
|
||||
export function OlModule_Layer_VectorTileProps$reflection() {
|
||||
return union_type("Fable.OpenLayers.OlModule.Layer.VectorTileProps", [], OlModule_Layer_VectorTileProps, () => [[["Item", class_type("Fable.OpenLayers.Interfaces.Source.ISource")]], [["Item", int32_type]], [["Item", class_type("Fable.OpenLayers.Interfaces.TileGrid.ITileGrid")]]]);
|
||||
}
|
||||
|
||||
export class OlModule_Layer_LayerProps extends Union {
|
||||
constructor(tag, ...fields) {
|
||||
super();
|
||||
this.tag = (tag | 0);
|
||||
this.fields = fields;
|
||||
}
|
||||
cases() {
|
||||
return ["Blur", "Radius"];
|
||||
}
|
||||
}
|
||||
|
||||
export function OlModule_Layer_LayerProps$reflection() {
|
||||
return union_type("Fable.OpenLayers.OlModule.Layer.LayerProps", [], OlModule_Layer_LayerProps, () => [[["Item", int32_type]], [["Item", int32_type]]]);
|
||||
}
|
||||
|
||||
export function OlModule_Layer_LayerProps_XYZSource_Z3BA24FEC(x) {
|
||||
return ["source", x];
|
||||
}
|
||||
|
||||
export function OlModule_Layer_LayerProps_VectorTileSource_Z7991DE3E(x) {
|
||||
return ["source", x];
|
||||
}
|
||||
|
||||
export function OlModule_Layer_tile(options) {
|
||||
const opts = keyValueList(options, 1);
|
||||
return new Tile(opts);
|
||||
}
|
||||
|
||||
export function OlModule_Layer_vector(options) {
|
||||
const opts = keyValueList(options, 1);
|
||||
return new Vector_1(opts);
|
||||
}
|
||||
|
||||
export function OlModule_Layer_vectorTile(options) {
|
||||
const opts = keyValueList(options, 1);
|
||||
return new VectorTile_1(opts);
|
||||
}
|
||||
|
||||
export class OlModule_ViewProps extends Union {
|
||||
constructor(tag, ...fields) {
|
||||
super();
|
||||
this.tag = (tag | 0);
|
||||
this.fields = fields;
|
||||
}
|
||||
cases() {
|
||||
return ["Projection", "Center", "Zoom", "OnClick"];
|
||||
}
|
||||
}
|
||||
|
||||
export function OlModule_ViewProps$reflection() {
|
||||
return union_type("Fable.OpenLayers.OlModule.ViewProps", [], OlModule_ViewProps, () => [[["Item", class_type("Fable.OpenLayers.Interfaces.Proj.IProjection")]], [["Item", array_type(float64_type)]], [["Item", int32_type]], [["Item", lambda_type(unit_type, unit_type)]]]);
|
||||
}
|
||||
|
||||
export class OlModule_MapProps extends Union {
|
||||
constructor(tag, ...fields) {
|
||||
super();
|
||||
this.tag = (tag | 0);
|
||||
this.fields = fields;
|
||||
}
|
||||
cases() {
|
||||
return ["Target", "Layers", "View"];
|
||||
}
|
||||
}
|
||||
|
||||
export function OlModule_MapProps$reflection() {
|
||||
return union_type("Fable.OpenLayers.OlModule.MapProps", [], OlModule_MapProps, () => [[["Item", obj_type]], [["Item", array_type(class_type("Fable.OpenLayers.Interfaces.Layer.ILayer"))]], [["Item", class_type("Fable.OpenLayers.Interfaces.IView")]]]);
|
||||
}
|
||||
|
||||
export function OlModule_view(options) {
|
||||
const opts = keyValueList(options, 1);
|
||||
return new View(opts);
|
||||
}
|
||||
|
||||
export function OlModule_map(options) {
|
||||
const opts = keyValueList(options, 1);
|
||||
return new Map$(opts);
|
||||
}
|
||||
|
||||
1377
package-lock.json
generated
Normal file
1377
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
18
package.json
Normal file
18
package.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"install": "dotnet tool restore; femto src/",
|
||||
"build": "dotnet fable src -o dist/",
|
||||
"start": "dotnet fable watch src -s -o dist/"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@semantic-release/changelog": "^6.0.1",
|
||||
"@semantic-release/exec": "^6.0.3",
|
||||
"@semantic-release/git": "^10.0.1",
|
||||
"@semantic-release/gitlab": "^7.0.4",
|
||||
"semantic-release-dotnet": "^1.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"ol": "^6.14.1"
|
||||
}
|
||||
}
|
||||
509
src/Fable.OpenLayers.fs
Normal file
509
src/Fable.OpenLayers.fs
Normal file
@@ -0,0 +1,509 @@
|
||||
namespace Fable.OpenLayers
|
||||
|
||||
open Fable.Core
|
||||
open Fable.Core.JsInterop
|
||||
|
||||
module Types =
|
||||
type Url = string
|
||||
|
||||
type Extent = float []
|
||||
|
||||
type Resolutions = float []
|
||||
|
||||
type TileSize = int
|
||||
|
||||
type MinZoom = int
|
||||
|
||||
type Zoom = int
|
||||
|
||||
type Center = float []
|
||||
|
||||
type WMTSConfig = {
|
||||
``layer`` : string
|
||||
``matrixSet`` : string
|
||||
}
|
||||
|
||||
module rec Interfaces =
|
||||
open Types
|
||||
|
||||
[<RequireQualifiedAccess>]
|
||||
module Proj =
|
||||
type IProjection =
|
||||
abstract member ``getExtent`` : unit -> Extent
|
||||
abstract member ``setExtent`` : Extent -> unit
|
||||
abstract member ``getWorldExtent`` : unit -> Extent
|
||||
|
||||
type IProjectionStatic =
|
||||
[<Emit("new $0($1)")>]
|
||||
abstract New : obj -> IProjection
|
||||
|
||||
type IProj4 =
|
||||
[<Emit("register($1)")>]
|
||||
abstract member Register : obj -> unit
|
||||
|
||||
[<RequireQualifiedAccess>]
|
||||
module Geom =
|
||||
type IGeometry = interface end
|
||||
|
||||
[<RequireQualifiedAccess>]
|
||||
module Style =
|
||||
type IStyle = interface end
|
||||
|
||||
type IStroke = IStyle
|
||||
|
||||
type IStrokeStatic =
|
||||
[<Emit("new $0($1)")>]
|
||||
abstract New : obj -> IStroke
|
||||
|
||||
type IFill = IStyle
|
||||
|
||||
type IFillStatic =
|
||||
[<Emit("new $0($1)")>]
|
||||
abstract New : obj -> IFill
|
||||
|
||||
type IText = IStyle
|
||||
|
||||
type ITextStatic =
|
||||
[<Emit("new $0($1)")>]
|
||||
abstract New : obj -> IFill
|
||||
|
||||
type IStyleStatic =
|
||||
[<Emit("new $0($1)")>]
|
||||
abstract New : obj -> IStyle
|
||||
|
||||
[<RequireQualifiedAccess>]
|
||||
module Format =
|
||||
type IFormat = interface end
|
||||
|
||||
type IMVT = IFormat
|
||||
|
||||
type IGeoJSON =
|
||||
inherit IFormat
|
||||
abstract member ``readFeature`` : obj -> IGeoJSON
|
||||
abstract member ``readFeatures`` : obj -> IGeoJSON
|
||||
|
||||
type IGeoJSONStatic =
|
||||
[<Emit("new $0($1)")>]
|
||||
abstract New : obj -> IGeoJSON
|
||||
|
||||
type IMVTStatic =
|
||||
[<Emit("new $0()")>]
|
||||
abstract New : unit -> IMVT
|
||||
|
||||
type IWMTSCapabilities =
|
||||
inherit IFormat
|
||||
abstract member ``read`` : string -> obj
|
||||
|
||||
type IWMTSCapabilitiesStatic =
|
||||
[<Emit("new WMTSCapabilities()")>]
|
||||
abstract New : unit -> IWMTSCapabilities
|
||||
|
||||
type IOptionsFromCapabilities =
|
||||
[<Emit("optionsFromCapabilities($1, $2)")>]
|
||||
abstract member ``optionsFromCapabilities`` : obj -> WMTSConfig -> obj
|
||||
|
||||
[<RequireQualifiedAccess>]
|
||||
module TileGrid =
|
||||
type MatrixIds = float []
|
||||
|
||||
type ITileGrid = interface end
|
||||
|
||||
type IWMTS = ITileGrid
|
||||
|
||||
type ITileGridStatic =
|
||||
[<Emit("new $0($1)")>]
|
||||
abstract New : obj -> ITileGrid
|
||||
|
||||
type IWMTSStatic =
|
||||
[<Emit("new $0($1)")>]
|
||||
abstract New : obj -> IWMTSStatic
|
||||
|
||||
[<RequireQualifiedAccess>]
|
||||
module Source =
|
||||
type ISource = interface end
|
||||
|
||||
type IXYZ =
|
||||
inherit ISource
|
||||
abstract ``clear`` : unit -> unit
|
||||
abstract ``getUrls`` : unit -> string []
|
||||
abstract ``setUrl`` : string -> unit
|
||||
abstract ``refresh`` : unit -> unit
|
||||
|
||||
type IXYZStatic =
|
||||
[<Emit("new $0($1)")>]
|
||||
abstract New : obj -> IXYZ
|
||||
|
||||
type IOSM = ISource
|
||||
|
||||
type IOSMStatic =
|
||||
[<Emit("new $0()")>]
|
||||
abstract New : unit -> IOSM
|
||||
|
||||
type IVector = ISource
|
||||
|
||||
type IVectorStatic =
|
||||
[<Emit("new $0($1)")>]
|
||||
abstract New : obj -> IVector
|
||||
|
||||
type IVectorTile =
|
||||
inherit ISource
|
||||
abstract setTileLoadFunction : (Tile.ITile -> string -> unit) -> unit
|
||||
|
||||
type IVectorTileStatic =
|
||||
[<Emit("new $0($1)")>]
|
||||
abstract New : obj -> IVectorTile
|
||||
|
||||
type ITileWMS = ISource
|
||||
|
||||
type ITileWMSStatic =
|
||||
[<Emit("new $0($1)")>]
|
||||
abstract New : obj -> ITileWMS
|
||||
|
||||
type IWMTS = ISource
|
||||
|
||||
type IWMTSStatic =
|
||||
[<Emit("new $0($1)")>]
|
||||
abstract New : obj -> IWMTS
|
||||
|
||||
|
||||
[<RequireQualifiedAccess>]
|
||||
module Layer =
|
||||
type ILayer =
|
||||
abstract ``setOpacity`` : float -> unit
|
||||
abstract ``getSource`` : unit -> obj
|
||||
|
||||
type IVector = ILayer
|
||||
|
||||
type IVectorStatic =
|
||||
[<Emit("new $0($1)")>]
|
||||
abstract New : obj -> IVector
|
||||
|
||||
type ITile = ILayer
|
||||
|
||||
type ITileStatic =
|
||||
[<Emit("new $0($1)")>]
|
||||
abstract New : obj -> ITile
|
||||
|
||||
type IVectorTile = ILayer
|
||||
|
||||
type IVectorTileStatic =
|
||||
[<Emit("new $0($1)")>]
|
||||
abstract New : obj -> IVectorTile
|
||||
|
||||
[<RequireQualifiedAccess>]
|
||||
module Tile =
|
||||
type ITile =
|
||||
abstract member ``setFeatures`` : Format.IGeoJSON -> unit
|
||||
abstract member ``setState`` : obj -> unit
|
||||
abstract member ``load`` : unit -> unit
|
||||
abstract member ``getTileCoord`` : unit -> float []
|
||||
|
||||
type IView =
|
||||
abstract ``setCenter`` : obj -> unit
|
||||
abstract ``setZoom`` : int -> unit
|
||||
abstract ``setOrientation`` : obj -> unit
|
||||
|
||||
type IViewStatic =
|
||||
[<Emit("new $0($1)")>]
|
||||
abstract New : obj -> IView
|
||||
|
||||
type IMap =
|
||||
abstract ``target`` : obj
|
||||
abstract ``setTarget`` : string -> unit
|
||||
abstract ``getView`` : unit -> IView
|
||||
abstract ``getSize`` : unit -> (float * float)
|
||||
abstract ``setSize`` : (float * float) -> unit
|
||||
abstract ``changed`` : unit -> unit
|
||||
abstract ``render`` : unit -> unit
|
||||
abstract ``getLayers`` : unit -> Layer.ILayer []
|
||||
abstract ``addLayer`` : Layer.ILayer -> unit
|
||||
|
||||
type IMapStatic =
|
||||
[<Emit("new $0($1)")>]
|
||||
abstract New : obj -> IMap
|
||||
|
||||
type Ol =
|
||||
[<Import("Map", "ol")>]
|
||||
static member Map : Interfaces.IMapStatic = jsNative
|
||||
|
||||
[<Import("View", "ol")>]
|
||||
static member View : Interfaces.IViewStatic = jsNative
|
||||
|
||||
module Imports =
|
||||
open Interfaces
|
||||
|
||||
type Proj =
|
||||
[<Import("default", "ol/proj/Projection")>]
|
||||
static member Projection : Proj.IProjectionStatic = jsNative
|
||||
|
||||
[<Import("fromLonLat", "ol/proj")>]
|
||||
static member FromLonLat (x : float []) : float [] = jsNative
|
||||
|
||||
[<Import("transform", "ol/proj")>]
|
||||
static member Transform (x : float [], y : Proj.IProjection, z : Proj.IProjection) : float [] = jsNative
|
||||
|
||||
[<Import("get","ol/proj")>]
|
||||
static member GetProj (x : string) : Proj.IProjection = jsNative
|
||||
|
||||
[<Import("register", "ol/proj/proj4")>]
|
||||
static member Proj4 : Proj.IProj4 = jsNative
|
||||
|
||||
|
||||
type Style =
|
||||
[<Import("default", "ol/style/Style")>]
|
||||
static member Style : Style.IStyleStatic = jsNative
|
||||
|
||||
[<Import("default", "ol/style/Stroke")>]
|
||||
static member Stroke : Style.IStrokeStatic = jsNative
|
||||
|
||||
[<Import("default", "ol/style/Style")>]
|
||||
static member Fill : Style.IFillStatic = jsNative
|
||||
|
||||
type Format =
|
||||
[<Import("default", "ol/format/MVT")>]
|
||||
static member MVT : Format.IMVTStatic = jsNative
|
||||
|
||||
[<Import("default", "ol/format/WMTSCapabilities")>]
|
||||
static member WMTSCapabilities : Format.IWMTSCapabilitiesStatic = jsNative
|
||||
|
||||
[<Import("default", "ol/format/GeoJSON")>]
|
||||
static member GeoJSON : Format.IGeoJSONStatic = jsNative
|
||||
|
||||
type TileGrid =
|
||||
[<Import("default", "ol/tilegrid/TileGrid")>]
|
||||
static member TileGrid : TileGrid.ITileGridStatic = jsNative
|
||||
|
||||
[<Import("default", "ol/tilegrid/WMTS")>]
|
||||
static member WMTS : TileGrid.IWMTSStatic = jsNative
|
||||
|
||||
type Source =
|
||||
[<Import("default", "ol/source/Vector")>]
|
||||
static member Vector : Source.IVectorStatic = jsNative
|
||||
|
||||
[<Import("default", "ol/source/VectorTile")>]
|
||||
static member VectorTile : Source.IVectorTileStatic = jsNative
|
||||
|
||||
[<Import("default", "ol/source/OSM")>]
|
||||
static member OSM : Source.IOSMStatic = jsNative
|
||||
|
||||
[<Import("default", "ol/source/TileWMS")>]
|
||||
static member TileWMS : Source.ITileWMSStatic = jsNative
|
||||
|
||||
[<Import("default", "ol/source/WMTS")>]
|
||||
static member WMTS : Source.IWMTSStatic = jsNative
|
||||
|
||||
[<Import("optionsFromCapabilities", "ol/source/WMTS")>]
|
||||
static member OptionsFromCapabilities : Format.IOptionsFromCapabilities = jsNative
|
||||
|
||||
[<Import("default", "ol/source/XYZ")>]
|
||||
static member XYZ : Source.IXYZStatic = jsNative
|
||||
|
||||
type Layer =
|
||||
[<Import("default", "ol/layer/Vector")>]
|
||||
static member Vector : Layer.IVectorStatic = jsNative
|
||||
|
||||
[<Import("default", "ol/layer/VectorTile")>]
|
||||
static member VectorTile : Layer.IVectorTileStatic = jsNative
|
||||
|
||||
[<Import("default", "ol/layer/Tile")>]
|
||||
static member Tile : Layer.ITileStatic = jsNative
|
||||
|
||||
type Extent =
|
||||
[<Import("getTopLeft", "ol/extent")>]
|
||||
static member GetTopLeft (x : Extent) : float = jsNative
|
||||
|
||||
[<Import("getWidth", "ol/extent")>]
|
||||
static member GetWidth (x : Extent) : float = jsNative
|
||||
|
||||
module Ol =
|
||||
open Interfaces
|
||||
|
||||
module Proj =
|
||||
type ProjectionProps =
|
||||
| Code of string
|
||||
| Unit of string
|
||||
| Extent of int [] []
|
||||
|
||||
let projection (options : ProjectionProps seq) =
|
||||
let opts = keyValueList CaseRules.LowerFirst options
|
||||
Imports.Proj.Projection.New opts
|
||||
|
||||
module Format =
|
||||
type GeoJSONProps =
|
||||
| DataProjection of Proj.IProjection
|
||||
|
||||
let geoJSON (options : GeoJSONProps seq) =
|
||||
let opts = keyValueList CaseRules.LowerFirst options
|
||||
Imports.Format.GeoJSON.New opts
|
||||
|
||||
let mvt () =
|
||||
Imports.Format.MVT.New ()
|
||||
|
||||
module Style =
|
||||
type StyleProps =
|
||||
| Fill of Style.IFill
|
||||
| Stroke of Style.IStroke
|
||||
| Text of Style.IText
|
||||
| ZIndex of int
|
||||
| Geometry of Geom.IGeometry
|
||||
| Image of obj
|
||||
| Renderer of obj
|
||||
|
||||
type StrokeProps =
|
||||
| Color of string
|
||||
| Width of float
|
||||
| LineCap of string
|
||||
| LineDash of float []
|
||||
|
||||
type FillProps =
|
||||
| Color of string
|
||||
|
||||
type TextProps =
|
||||
| Text of string
|
||||
| Align of string
|
||||
| Fill of Style.IFill
|
||||
| Stroke of Style.IStroke
|
||||
| BackgroundFill of Style.IFill
|
||||
| BackgroundStroke of Style.IStroke
|
||||
| Font of string
|
||||
| Scale of float
|
||||
| Padding of float []
|
||||
| Rotation of float
|
||||
|
||||
let stroke (options : StrokeProps seq) =
|
||||
let opts = keyValueList CaseRules.LowerFirst options
|
||||
Imports.Style.Stroke.New opts
|
||||
|
||||
let fill (options : FillProps seq) =
|
||||
let opts = keyValueList CaseRules.LowerFirst options
|
||||
Imports.Style.Fill.New opts
|
||||
|
||||
let style (options : StyleProps seq) =
|
||||
let opts = keyValueList CaseRules.LowerFirst options
|
||||
Imports.Style.Style.New opts
|
||||
|
||||
module TileGrid =
|
||||
type TileGridProps =
|
||||
| Extent of float []
|
||||
| Resolution of float []
|
||||
| MatrixIds of float []
|
||||
|
||||
type WMTSProps =
|
||||
| Extent of float []
|
||||
| Resolution of float []
|
||||
| MatrixIds of float []
|
||||
|
||||
let tileGrid (options : TileGridProps seq) =
|
||||
let opts = keyValueList CaseRules.LowerFirst options
|
||||
Imports.TileGrid.TileGrid.New opts
|
||||
|
||||
let wmts (options : WMTSProps seq) =
|
||||
let opts = keyValueList CaseRules.LowerFirst options
|
||||
Imports.TileGrid.WMTS.New opts
|
||||
|
||||
module Source =
|
||||
type VectorProps =
|
||||
| Features of Format.IFormat
|
||||
|
||||
type XYZProps =
|
||||
| Projection of Proj.IProjection
|
||||
| Url of string
|
||||
|
||||
type VectorTileProps =
|
||||
| TileLoadFunction of (Tile.ITile -> string -> unit)
|
||||
| TileUrlFunction of (int [] * int * Proj.IProjection -> string)
|
||||
| Projection of Proj.IProjection
|
||||
| Format of Format.IFormat
|
||||
| TileGrid of TileGrid.ITileGrid
|
||||
| TileSize of int
|
||||
| Url of string
|
||||
| TilePixelRatio of int
|
||||
|
||||
type TileWMSProps =
|
||||
| Url of string
|
||||
| Params of obj
|
||||
| ServerType of string
|
||||
| Transition of string
|
||||
|
||||
type WMTSProps =
|
||||
| Url of string
|
||||
| Layer of string
|
||||
| Format of Format.IFormat
|
||||
| Projection of Proj.IProjection
|
||||
| TileGrid of TileGrid.ITileGrid
|
||||
| WarpX of bool
|
||||
| Style of Style.IStyle
|
||||
|
||||
let vector (options : VectorProps seq) =
|
||||
let opts = keyValueList CaseRules.LowerFirst options
|
||||
Imports.Source.Vector.New opts
|
||||
|
||||
let xyz (options : XYZProps seq) =
|
||||
let opts = keyValueList CaseRules.LowerFirst options
|
||||
Imports.Source.XYZ.New opts
|
||||
|
||||
let vectorTile (options : VectorTileProps seq) =
|
||||
let opts = keyValueList CaseRules.LowerFirst options
|
||||
Imports.Source.VectorTile.New opts
|
||||
|
||||
let tileWMS (options : TileWMSProps seq) =
|
||||
let opts = keyValueList CaseRules.LowerFirst options
|
||||
Imports.Source.TileWMS.New opts
|
||||
|
||||
let wmts (options : WMTSProps seq) =
|
||||
let opts = keyValueList CaseRules.LowerFirst options
|
||||
Imports.Source.WMTS.New opts
|
||||
|
||||
module Layer =
|
||||
type VectorProps =
|
||||
| Source of Source.ISource
|
||||
| Style of Style.IStyle
|
||||
| MinZoom of int
|
||||
|
||||
type TileProps =
|
||||
| Source of Source.ISource
|
||||
| MinZoom of int
|
||||
|
||||
type VectorTileProps =
|
||||
| Source of Source.ISource
|
||||
| MinZoom of int
|
||||
| TileGrid of TileGrid.ITileGrid
|
||||
|
||||
type LayerProps =
|
||||
| Blur of int
|
||||
| Radius of int
|
||||
static member XYZSource (x : Source.IXYZ ) =
|
||||
!!("source", x)
|
||||
static member VectorTileSource (x : Source.IVectorTile) =
|
||||
!!("source", x)
|
||||
|
||||
let tile (options : TileProps seq) =
|
||||
let opts = keyValueList CaseRules.LowerFirst options
|
||||
Imports.Layer.Tile.New opts
|
||||
|
||||
let vector (options : VectorProps seq) =
|
||||
let opts = keyValueList CaseRules.LowerFirst options
|
||||
Imports.Layer.Vector.New opts
|
||||
|
||||
let vectorTile (options : VectorTileProps seq) =
|
||||
let opts = keyValueList CaseRules.LowerFirst options
|
||||
Imports.Layer.VectorTile.New opts
|
||||
|
||||
type ViewProps =
|
||||
| Projection of Proj.IProjection
|
||||
| Center of float []
|
||||
| Zoom of int
|
||||
| OnClick of (unit -> unit)
|
||||
|
||||
type MapProps =
|
||||
| Target of obj
|
||||
| Layers of Layer.ILayer []
|
||||
| View of IView
|
||||
|
||||
let view (options : ViewProps seq) =
|
||||
let opts = keyValueList CaseRules.LowerFirst options
|
||||
Ol.View.New opts
|
||||
|
||||
let map (options : MapProps seq) =
|
||||
let opts = keyValueList CaseRules.LowerFirst options
|
||||
Ol.Map.New opts
|
||||
24
src/Fable.OpenLayers.fsproj
Normal file
24
src/Fable.OpenLayers.fsproj
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<PropertyGroup>
|
||||
<OutputType>Library</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
|
||||
<IsPackable>true</IsPackable>
|
||||
<PackageId>Fable.OpenLayers</PackageId>
|
||||
<Authors></Authors>
|
||||
<Company></Company>
|
||||
<Version>0.0.1</Version>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Fable.OpenLayers.fs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Fable.Core" Version="3.7.0" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<NpmDependencies>
|
||||
<NpmPackage Name="ol" Version="gte 6.14.1" ResolutionStrategy="Max" />
|
||||
</NpmDependencies>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
19
src/packages.lock.json
Normal file
19
src/packages.lock.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"version": 1,
|
||||
"dependencies": {
|
||||
"net6.0": {
|
||||
"Fable.Core": {
|
||||
"type": "Direct",
|
||||
"requested": "[3.7.0, )",
|
||||
"resolved": "3.7.0",
|
||||
"contentHash": "T+67w7XUaqHp2Lm9ESvrPoy7MrCFOYpUg6ASX4F+E1XDDnH+ElW2t1Jt+FjahRZZk6cS14i8JACte57P32FW9Q=="
|
||||
},
|
||||
"FSharp.Core": {
|
||||
"type": "Direct",
|
||||
"requested": "[6.0.1, )",
|
||||
"resolved": "6.0.1",
|
||||
"contentHash": "VrFAiW8dEEekk+0aqlbvMNZzDvYXmgWZwAt68AUBqaWK8RnoEVUNglj66bZzhs4/U63q0EfXlhcEKnH1sTYLjw=="
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
18
test/Tests.fs
Normal file
18
test/Tests.fs
Normal file
@@ -0,0 +1,18 @@
|
||||
module Tests
|
||||
|
||||
open Expecto
|
||||
|
||||
let server =
|
||||
testList
|
||||
"Server"
|
||||
[
|
||||
testCase "Adding valid Todo"
|
||||
<| fun _ ->
|
||||
let expectedResult = Ok()
|
||||
Expect.equal (Ok()) expectedResult "Result should be ok"
|
||||
]
|
||||
|
||||
let all = testList "All" [ server ]
|
||||
|
||||
[<EntryPoint>]
|
||||
let main _ = runTests defaultConfig all
|
||||
16
test/Tests.fsproj
Normal file
16
test/Tests.fsproj
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Tests.fs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\src\Fable.OpenLayers.fsproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Expecto" Version="9.0.4" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user