GithubHelp home page GithubHelp logo

Comments (14)

istarkov avatar istarkov commented on May 22, 2024

I can't, have no access to any ios device.

from google-map-react.

jedwards1211 avatar jedwards1211 commented on May 22, 2024

I do, I can test this out at some point. @arvinkx are you using fastclick or anything like it?

from google-map-react.

arvinkx avatar arvinkx commented on May 22, 2024

I'm actually experiencing the problem with the examples included here as well as my own project - http://istarkov.github.io/google-map-react/map/main/ - let me know if I can do anything to help, I don't think my skill set is quite as refined as yours but I am willing to help anyway I can if you actually are able to reproduce the issue on your end also.

from google-map-react.

jedwards1211 avatar jedwards1211 commented on May 22, 2024

It'll be a bit tricky to debug I'm sure. Probably it will be necessary to put print statements in your local copy of the google map source and use something like http://jsconsole.com to see what it prints out from your iPhone (though I think if you own a Mac there's a better debugging experience?) I'm just busy so I don't know exactly when I could take a look at this issue, but if I can give you pointers on investigating it yourself you might be able to figure it out before I have time to look at it.

from google-map-react.

jedwards1211 avatar jedwards1211 commented on May 22, 2024

Oh, looking through the code I see what the problem is. The method that handles the mouse click event just calls your handler with whatever marker is currently hovered. Works fine on a computer with an actual mouse, but since hovering works differently on touch devices, that's why you're seeing the issue. Later I'll try to make it go use the "what marker is closest to this x,y" logic on a mouse click instead of using the hovered marker.

from google-map-react.

arvinkx avatar arvinkx commented on May 22, 2024

Ok, I have access to iOS Safari debugging (I have a Mac and you can remote debug using safari on both devices) so if you need anything from me let me know, and again thanks for all the help, it's greatly appreciated.

from google-map-react.

martingg88 avatar martingg88 commented on May 22, 2024

anyone manage to solve this issue?

from google-map-react.

arvinkx avatar arvinkx commented on May 22, 2024

I was able to solve the problem in the way @jedwards1211 described, I have extensively altered my version and haven't had time to do a PR for the items. You need to rewrite the selection logic as it uses the item that is currently being hovered to determine which child to select - I rewrote the logic to add touch events and now the logic looks for the nearest marker (using R-Tree - I had already integrated an R-tree library for another feature I wanted).

from google-map-react.

martingg88 avatar martingg88 commented on May 22, 2024

do you mind to share that portion of code?

from google-map-react.

arvinkx avatar arvinkx commented on May 22, 2024

I no longer have access to the code in question but from what I can remember google_maps.js needs to have touchstart and touchend events added to the map in the initMap function and the onMouseMove function needs to check the event to see if it is fired due to touch and respond by reading the touch coordinates instead. Then google_map_markers.js needs to be modified to include an R-Tree-type library (I used r-bush) and in onChildClick you use the R-Tree library to search for the nearest map markers to the coordinates where the touch/click occurred. Hopefully this helps get what you need.

from google-map-react.

martingg88 avatar martingg88 commented on May 22, 2024

hope there is someone else who can help to solve this issue. anyone?

from google-map-react.

istarkov avatar istarkov commented on May 22, 2024

Can solve any issue in exchange for http://www.apple.com/ipad-pro/ ;-)

from google-map-react.

hellogerard avatar hellogerard commented on May 22, 2024

I was very excited to use this library on Cordova, and ran into this issue too :-(

As a workaround, it appears that standard React touch events work on the marker component itself. This may work for you, depending on what you're trying to do. You'd then have to pass in a callback to affect the map itself.

(not tested):

const MapMarker = React.createClass({
  propTypes: {
    onMarkerClicked: React.PropType.func
  },

  onClick() {
    this.props.onMarkerClicked();
  },

  render() {
    return (
      <div onClick={this.onClick}>
        marker
      </div>
    );
  }
});

export default MapMarker;

from google-map-react.

martingg88 avatar martingg88 commented on May 22, 2024

many thanks to you. will try it out and see how it work.

from google-map-react.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.