markerclusterer - Clicking on marker cluster wants to open spider with exact same location markers by default -


I was trying to apply MarkerCluster (MS) with overlapping marker cluster (OMS). Everything seems to work well

However, I am looking to modify the way OMS works so that I can click on that cluster which has 2 digits below

When I click with 2 points on a cluster, with the exact same geographical location, it opens a marker and when I click on that marker it opens the spider with 2 markers.

When I click on the cluster, make a spider with 2 markers, still not enough work to spend a lot of time.

I have already tried several solutions, like

1. When I'm adding the marker to the OMS (Om.Adm marker), I can track and click on the basis of Google Map's zoom_evited event, but due to this we add it to markers, the firing of it Click do not shoot event .....

2 I see an event splitfish, so I tried to trigger that event with the marker object (Om .. transger ('SpiderFai ', Marker);) But nothing is working ...

Here I am also adding the code snippet:

MC = New marker cluster (map, Marker. Location, mcoption); Google.maps.event.addListener (MC, 'clusterclick', function (cluster) {code> enter code here clusterClicked = true; // here we want to fire the spider functionality ...})

I can solve this problem, first of all it is clear that you have implemented And Overlapping Exlaster marker marker cluster in your Google Maps.

My solution is very simple.

  1. We capture the click event of MarkerCluster.
  2. Get the marker
  3. Check if all marker marker markers are in the same condition or not.
  4. If they are in the same position, we get the marker cluster marker to the click event. In short, this code is:
      var markerClusterer = new marker cluster (map, all markers, {styles: styles [0], cluster class: ' Piqulester ', Maximum Zoom: 18}); Google.maps.event.addListener (MarkerClusters, 'Click', Function (Cluster) {var Marker = Cluster.Great Markers (); if (AstonatosAnalmassa Pausenen (Marker)) {// Waiting for Map Update Setting ( Function () {google.maps.event.trigger (marker [markers.length-1], 'click');}, 1000)} back true;}); Function estanTodosEnLaMismaPosicion (marker) {var cont = 0; Var latitudMaster = Marker [0] .getPosition () Lat (); Var longitudMaster = Marker [0] .getPosition (). Lng (); (Var i = 0; i & lt; marker langati; i ++) {if (marker [i] .getPosition (). Lat () === latitude and mister [i] .getPosition () .lng () == = Lolitaid Master) {cont ++; } Other {return false; }} If (cont == markers.length) {return true; } And if (cont & lt; marker. Lamp) {return false; }}    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

jsp - Google line chart x-axis shrinks on transition -

java - Reaching JTextField in a DocumentListener -