1111 <ol-source-osm />
1212 </ol-tile-layer >
1313
14- <ol-tile-layer ref =" jawgLayer" title =" JAWG" >
14+ <ol-tile-layer ref =" jawgLayer" title =" JAWG" >
1515 <ol-source-xyz crossOrigin =' anonymous' url =" https://c.tile.jawg.io/jawg-dark/{z}/{x}/{y}.png?access-token=87PWIbRaZAGNmYDjlYsLkeTVJpQeCfl2Y61mcHopxXqSdxXExoTLEv7dwqBwSWuJ" />
1616 </ol-tile-layer >
1717
5959 </ol-interaction-select >
6060
6161 <ol-vector-layer title =" AIRPORTS" preview =" https://raw.githubusercontent.com/MelihAltintas/vue3-openlayers/main/src/assets/tr.png" >
62- <ol-source-vector ref =" cities" url =" https://raw.githubusercontent.com/alpers/Turkey-Maps-GeoJSON/master/tr-cities-airports.json" :format =" geoJson" :projection =" projection" >
62+ <ol-source-vector ref =" cities" url =" https://raw.githubusercontent.com/alpers/Turkey-Maps-GeoJSON/master/tr-cities-airports.json" :format =" geoJson" :projection =" projection" >
6363
6464 <ol-interaction-modify v-if =" drawEnable" @modifyend =" modifyend" @modifystart =" modifystart" >
6565
102102 <ol-animated-clusterlayer :animationDuration =" 500" :distance =" 40" title =" CLUSTER" preview =" https://raw.githubusercontent.com/MelihAltintas/vue3-openlayers/main/src/assets/cluster.png" >
103103
104104 <ol-source-vector ref =" vectorsource" >
105- <ol-feature v-for =" index in 500" :key =" index" >
105+ <ol-feature v-for =" index in 500" :key =" index" >
106106 <ol-geom-point :coordinates =" [getRandomInRange(24,45,3),getRandomInRange(35,41,3)]" ></ol-geom-point >
107107
108108 </ol-feature >
132132 </template >
133133 </ol-overlay >
134134
135- </ol-map >
135+ <ol-vector-layer >
136+ <ol-source-vector >
137+ <ol-feature ref =" animationPath" >
138+ <ol-geom-line-string :coordinates =" path" ></ol-geom-line-string >
139+ <ol-style >
140+ <ol-style-stroke color =" red" width =" 7" ></ol-style-stroke >
141+ </ol-style >
142+ </ol-feature >
143+ <ol-animation-path v-if =" animationPath" :path =" animationPath.feature" :duration =" 4000" :repeat =" 10" >
144+
145+ <ol-feature >
146+ <ol-geom-point :coordinates =" path[0]" ></ol-geom-point >
147+ <ol-style >
148+ <ol-style-circle :radius =" 10" >
149+ <ol-style-fill color =" blue" ></ol-style-fill >
150+ <ol-style-stroke color =" blue" :width =" 2" ></ol-style-stroke >
151+ </ol-style-circle >
152+ </ol-style >
136153
154+ </ol-feature >
155+ </ol-animation-path >
156+ </ol-source-vector >
157+
158+ </ol-vector-layer >
159+
160+ </ol-map >
137161</template >
138162
139163<script >
@@ -175,7 +199,6 @@ export default {
175199 const drawEnable = ref (false )
176200 const drawType = ref (" Point" )
177201
178-
179202 const changeDrawType = (active , draw ) => {
180203 drawEnable .value = active
181204 drawType .value = draw
@@ -268,12 +291,37 @@ export default {
268291 const jawgLayer = ref (null )
269292 const osmLayer = ref (null )
270293 const layerList = ref ([])
294+ const path = ref ([
295+ [
296+ 25.6064453125 ,
297+ 44.73302734375001
298+ ],
299+ [
300+ 27.759765625 ,
301+ 44.75500000000001
302+ ],
303+ [
304+ 28.287109375 ,
305+ 43.32677734375001
306+ ],
307+ [
308+ 30.55029296875 ,
309+ 46.40294921875001
310+ ],
311+ [
312+ 31.69287109375 ,
313+ 43.04113281250001
314+ ]
315+
316+ ])
317+ const animationPath = ref (null );
318+
271319 onMounted (() => {
272320
273321 layerList .value .push (jawgLayer .value .tileLayer );
274322 layerList .value .push (osmLayer .value .tileLayer );
275323 console .log (layerList .value )
276-
324+ console . log ( animationPath . value )
277325 });
278326
279327 return {
@@ -305,18 +353,19 @@ export default {
305353 osmLayer,
306354 starIcon,
307355 changeDrawType,
308-
356+ path,
357+ animationPath
309358 }
310359 },
311360}
312361 </script >
313- <style >
314362
363+ <style >
315364.overlay-content {
316365 background : red !important ;
317366 color : white ;
318367 box-shadow : 0 5px 10px rgb (2 2 2 / 20% );
319368 padding : 10px 20px ;
320369 font-size : 16px ;
321370}
322- </style >
371+ </style >
0 commit comments