-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ol-style-icon): allow to place icon content in slot
closes #295
- Loading branch information
1 parent
9a30ace
commit 65d970a
Showing
10 changed files
with
135 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<template> | ||
<ol-map | ||
ref="map" | ||
:loadTilesWhileAnimating="true" | ||
:loadTilesWhileInteracting="true" | ||
style="height: 400px" | ||
> | ||
<ol-view | ||
ref="view" | ||
:center="center" | ||
:zoom="zoom" | ||
:projection="projection" | ||
/> | ||
|
||
<ol-tile-layer> | ||
<ol-source-osm /> | ||
</ol-tile-layer> | ||
|
||
<ol-vector-layer> | ||
<ol-source-vector | ||
url="https://raw.githubusercontent.com/alpers/Turkey-Maps-GeoJSON/master/tr-cities-airports.json" | ||
:format="geoJson" | ||
:projection="projection" | ||
> | ||
</ol-source-vector> | ||
<ol-style> | ||
<ol-style-stroke color="red" :width="2"></ol-style-stroke> | ||
<ol-style-fill color="rgba(255,255,255,0.1)"></ol-style-fill> | ||
<ol-style-icon :scale="1"> | ||
<span class="marker">📍</span> | ||
</ol-style-icon> | ||
</ol-style> | ||
</ol-vector-layer> | ||
</ol-map> | ||
</template> | ||
|
||
<script setup> | ||
import { ref, inject } from "vue"; | ||
const center = ref([34, 39.13]); | ||
const projection = ref("EPSG:4326"); | ||
const zoom = ref(6.8); | ||
const format = inject("ol-format"); | ||
const geoJson = new format.GeoJSON(); | ||
</script> | ||
|
||
<style scoped> | ||
.marker { | ||
background-color: #ffddaa; | ||
padding: 10px; | ||
border-radius: 25px; | ||
margin: 5px; | ||
font-size: 25px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
declare module "dom-to-image-more"; |
Binary file removed
BIN
-364 KB
tests/__screenshots__/style.test.ts/ol-style-icon-should-render-1.png
Binary file not shown.
Binary file added
BIN
+349 KB
...hots__/style.test.ts/ol-style-icon-should-render-icons-defined-by-src-URL-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+335 KB
...nshots__/style.test.ts/ol-style-icon-should-render-icons-from-slot-conent-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters