D3, Google Maps, selection of d3 elements
source link: https://www.codesd.com/item/d3-google-maps-selection-of-d3-elements.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
D3, Google Maps, selection of d3 elements
Per this example, I am trying to add marker selection, (i.e. add .on("click"...) to the marker variable). However, when you bring the mouse over the google maps canvas, you get the hand that lets you drag, and you cannot select any svg elements with it.
Is there a way to (temporary) disable that feature so you can click the D3 elements?
I'm working on building a map like this right now. I haven't used Google's markers (rather d3 SVG circles) but I found mouseover/click/etc events had to be on objects in the overlayMouseTarget layer of the map:
var overlay = new google.maps.OverlayView();
overlay.onAdd = function() {
var layer = d3.select(this.getPanes().overlayMouseTarget)
.append("div")
.attr("class", "providers");
...
}
I think the gMaps demo on d3js.org uses a different layer.
Related Articles
api v 3 google maps selecting cities
google maps select the infowindow DOM element from the angularjs directive
google maps api center to the correct location, but the arrow points to another
Google Maps as a texture map
How to use a Google map with a polymer?
Google Maps refresh traffic layer
AngularJS - changes the scope of a google maps directive of JSON according to the selected element
Google Maps AutoComplete Always Selects First Element
Google maps api v3 + canvas + chrome causes black boxes on youtube videos and map elements
Dynamically change the google maps src script with select
Ionic 2 Can not handle the menu in front of an element google maps
Google Maps & lt; Div & gt; Kills the other elements of the page
Google map android api v2 select polyline
Select From Layer List to Overlay on Google Maps
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK