1

D3, Google Maps, selection of d3 elements

 2 years ago
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.
neoserver,ios ssh client

D3, Google Maps, selection of d3 elements

advertisements

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

Hello is it possible to select custom address after geocoding? Like in image below? Also can look on this link from Google maps: click hereThe Twitter-API has a service that returns those polygon-boundaries. Add "Search Area" outline onto google

google maps select the infowindow DOM element from the angularjs directive

I need to select the element by class 'gm-style-iw' to fix some styles in Infowindow. The selection is happening inside of the angularjs directive. <div ui-view="full-map" id="full-map" class="mainMap col-xs-6"></div

google maps api center to the correct location, but the arrow points to another

I am using the Google Maps API. It's working for the most part, except I can't get the arrow to point to the right place. Here's my code: <div id="map1" style="height: 200px"></div> <script> function createInfoWindowC

Google Maps as a texture map

Hasn't anybody thought about creating dynamic texture of Google Maps? So for instance, we create a simple plane and apply a texture to it that is going to be an actual map of Google (with all of it properties, like drag, zoom, etc.). Would be nice to

How to use a Google map with a polymer?

I'd like to display a Google Map inside a polymer element. This map should be handled from outside of my component.Here's how to declare a simple custom element that contains a google map. In this example the map has to be handled manually outside of

Google Maps refresh traffic layer

In my Rails app, the background consists of a fullscreen div with Google Maps and a traffic layer. This is what gets called on page load: $(function () { updateMap(); }); The updateMap function creates a Google Map on the div element 'google_map': fu

AngularJS - changes the scope of a google maps directive of JSON according to the selected element

I have previously got an answer from here for how I can populate details form json based on item selected. Please see here for an example of what I am trying to achieve http://plnkr.co/edit/VQ2ZPY2PeLVySoCNQh92?p=preview how can I change the Latitude

Google Maps AutoComplete Always Selects First Element

I'm using Google Maps Places V3 autocomplete. I would like to have a functionality where if a user starts typing into the searchfield, the first item from the autocomplete drop down is automatically selected. Similar to the search function in Faceboo

Google maps api v3 + canvas + chrome causes black boxes on youtube videos and map elements

Im experiencing two problems.. Problem 1 This only happens on chrome on a mac, tried canary and older versions.. the rectangle is a <canvas> element.. here is a screenshot of it. It appears the black rectangles are where the marker would be. The mar

Dynamically change the google maps src script with select

I want to change the Google maps script src when one of my dropdown options is clicked because I'm having an issue when searching for zip codes on my page. To get the correct result I believe I need to use Google's Region Localization "&region=&q

Ionic 2 Can not handle the menu in front of an element google maps

I have made an Ionic V2 side menu application and integrated to it an GMaps element. But I can't handle the element which be in front of that map. The buttons of the side menu are disabled if they are in front of the map and it the same for the pop u

Google Maps & lt; Div & gt; Kills the other elements of the page

I've three elements: two tables and a div which is the canvas for gMaps. when this line <div id="map-canvas"/> is present, gMaps is displayed correctly, but my other elements aren't visible. Neither do they appear when inspecting element i

Google map android api v2 select polyline

I have problems with android google map api v2. I want to select a polyline from the map like I select a marker. With a marker I use onTap. Is it possible to select a polyline?You will have to write your own algorithm for that and do the checking in

Select From Layer List to Overlay on Google Maps

Can anyone advise me on how to select layers from a checkbox overlay the selected layer on google maps?JavaScript Version: Please consult the Google Maps API documentation. https://developers.google.com/maps/documentation/javascript/layers#TrafficLay

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK