[help] component inside geojson
See original GitHub issueHi,
Let’s use the example geojson component.
Now, let’s say that I want, for each geometry to bind a popup. Easy, in options I put a onEachFeature and place a bindPopup
options: {
onEachFeature (f. l) {
l.bindPopup(f.properties.nom)
}
}
Now is the tricky part : how can I add a component to this popup and even better, a router-link ? It really look like a dynamic component injection… It seems that this is not the right way to do things in vue.js (https://forum-archive.vuejs.org/topic/349/injecting-components-to-the-dom/2) but I can’t figure out how to do it.
In advance thanks
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top Results From Across the Web
Creating a Single GeoJSON component with two separate ...
I want to create a single GeoJSON component in React using react-leaflet to display the information through color on the map.
Read more >Canvas App Map component with GeoJSON
I'm working on a Canvas App that uses the Map component combined with the Address Input component to locate an address on a...
Read more >GeoJSON specification
GeoJSON is a geospatial data interchange format based on JavaScript Object Notation (JSON). It defines several types of JSON objects and the manner...
Read more >React Leaflet Tutorial using GeoJSON to Create a Map
React leaflet allows react developers to use components to build a leaflet map. We will be using the Map component, GeoJSON component to ......
Read more >Chapter 7 GeoJSON | Introduction to Web Mapping
In this chapter, we are going to learn about GeoJSON—a plain text format for vector layers. On the one hand, GeoJSON is a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @RemiDesgrange,
You can find a working example of this in examples/src/components/GeoJSON2.vue.
I’m closing this issue for now. If you still have trouble with this please reopen it.
Mickaël
Hi @RemiDesgrange ,
I use dynamic component mounting to dynamically add a Leaflet Control on my map depending on the fixture. It looks like:
the bindPopup method can receive an html element as argument, so using bindPopup(vm.$el) should do the trick.
Timothé