score:1
i should not manualy add the SVG layer. Leaflet have its own function for adding svg layer
this is my final code
MapLeaflet.prototype.init = function (map) {
let $$ = this;
$$.dom = map;
this.map = L.map(map).setView([-6.175239, 106.827204], 13);
L.tileLayer('http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png').addTo($$.map);
var svgLayer = L.svg();
svgLayer.addTo(this.map);
this.svg = d3.select('svg g');
}
Source: stackoverflow.com
Related Query
- SVG layer not rescale width map layer
- IE11 does not accept SVG height and width when using D3
- Export leaflet map WITH SVG layer to image
- D3 line graph not filling entire svg width
- d3 click handler not working on leaflet map layer
- Points on d3 map not on the same scale or part of the svg
- d3.js - extent width not match axis line with svg defs
- trouble with D3js world map and svg group element width
- Svg width not display de leftscale in d3.js heatmap /
- D3.js svg does not draw Map
- Simple React Map layer not loading until mouseEnter event
- Audio inside svg element d3 map not playing
- SVG foreignObject contents do not display unless plain text
- How do I get the width of an svg element using d3js?
- d3 click coordinates are relative to page not svg - how to translate them (Chrome error)
- Title Attribute not working for an SVG Rect on Safari
- d3.js - mouseover event not working properly on svg group
- SVG not rendering properly as a backbone view
- Auto width and height for SVG image
- internet explorer 10 not showing svg path (d3.js graph)
- D3 how to change the width and length of SVG
- Get width of d3.js SVG text element after it's created
- D3 - Positioning tooltip on SVG element not working
- Making SVG container 100% width and height of parent container in D3 v4 (instead of by pixels)
- maximum number of svg elements for the browser in a map
- Svg clip-path within rectangle does not work
- Scaling d3 v4 map to fit SVG (or at all)
- d3.on("mouseover") event does not work with nested SVG elements
- HTML element inside SVG not displayed
- Using d3.js svg clipPath not clipping in Angular
More Query from same tag
- DS.js JSON file format from CSV
- How to display Temperature, Wind Direction/Speed live data from GFS / NCEP / US National Weather Service on globe?
- Tick marks on both sides of axis on d3 scale
- x axis rescale using dropdown in line chart d3
- How to get the vertically-oriented tree using d3.js with rectangular box
- SVG path transition in D3 (v5) not working properly
- How to destroy multiple C3 graphs that were built from the same original function
- How does path.bounds() work?
- Joining GeoJSON to another GeoJSON
- How should I enqueue events in d3?
- Javascript URL string adding %20 (space) after running grunt
- Dynamic Sankey diagram with data from SQL server 2012
- Getting some weird bar which is not part of my data
- Filter selection by array without losing order d3js
- d3 make a force-directed-tree layout into a circle shape
- Single Stacked Bar Graph Data Setup?
- Can I use JasperReports like D3.js?
- while working with network chart, is there any why to color the common node with two different colors.?
- Change tooltips color d3.js
- D3.js - How to map continuous domains to discrete ranges with scales?
- d3 lat/long points are not lining up with map
- d3 horizontal bar chart with background and max value of 100%
- How to add label above the scatter plot?
- How to make d3.js generate an svg without drawing it?
- D3 - Setting the zoom scale of Double Click
- angular-datamaps not filling proper colour if "id" of a location has space
- d3.js adding polygon inside rectangle
- d3.layout.treemap in d3 version 4
- javascript - join arrays
- How to prepare data for d3 stacked barchart using rollup