question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

how to getMarkers as the same as angular leaflet directive leafData.getMarkers()

See original GitHub issue

hi, I want to get the markers, and set the icon’s stye. In Angular, I can do this with that:

// angular
leafletData.getMarkers().then((marker) => {
  marker._icon.style[L.DomUtil.TRANSFORM] = marker._icon.style[L.DomUtil.TRANSFORM].split("rotate(")[0];
  marker._icon.style[L.DomUtil.TRANSFORM] += 'rotate(' + marker.options.angle + 'deg)';
})

But in vue2leaflet, I have no idea to do this thing.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
DonNicoJscommented, Jul 25, 2018

I think this would work with your initial code:

<template>
  <l-marker ref="myMarker" />
</template>
<script>
this.$refs.myMarker.mapObject.getMarkers().then((marker) => {
  marker._icon.style[L.DomUtil.TRANSFORM] = marker._icon.style[L.DomUtil.TRANSFORM].split("rotate(")[0];
  marker._icon.style[L.DomUtil.TRANSFORM] += 'rotate(' + marker.options.angle + 'deg)';
})
</script>

Or by passing the icon to the component prop

0reactions
DonNicoJscommented, Sep 24, 2018

Closing this, since I believe is resolved

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to getMarkers as the same as angular leaflet directive leafData ...
hi, I want to get the markers, and set the icon's stye. In Angular, I can do this with that: // angular leafletData.getMarkers().then((marker)...
Read more >
Marker handle in angular-leaflet-directive - Stack Overflow
There's an leafletData service for that. The Promise you get when you call leafletData.getMarkers() resolves with the Leaflet marker objects ...
Read more >
Leaflet directive for AngularJS
Simple to use directive for easy embedding and interacting with a map managed with the leaflet map library on an AngularJS application.
Read more >
Is it possible to show Leaflet Marker Cluster with JSON API?
I have a problem with displaying Leaflet Marker Cluster ...
Read more >
angular-leaflet-directive - npm
AngularJS directive for the Leaflet Javascript Library. This software aims to easily embed maps managed by leaflet on your Leaflet project. You ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found