Comments (14)
I can't, have no access to any ios device.
from google-map-react.
I do, I can test this out at some point. @arvinkx are you using fastclick or anything like it?
from google-map-react.
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.
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.
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.
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.
anyone manage to solve this issue?
from google-map-react.
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.
do you mind to share that portion of code?
from google-map-react.
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.
hope there is someone else who can help to solve this issue. anyone?
from google-map-react.
Can solve any issue in exchange for http://www.apple.com/ipad-pro/ ;-)
from google-map-react.
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.
many thanks to you. will try it out and see how it work.
from google-map-react.
Related Issues (20)
- Hello, I want to use google-map-react in the Next.js 13 project, but for some reason it gives such an error HOT 1
- Component/Marker always re-center after map interaction HOT 18
- Make maps border-radius HOT 1
- the custom marker change position whenever i zoom or drag the map HOT 20
- Addition of Official Korean Documentation for Enhanced Accessibility
- Marker not showing HOT 4
- Markers are Flikering in React HOT 6
- googleMaps not server-side rendered on next.js HOT 3
- How to render default google maps markers with this library.
- Sponsored issue: How to render default google maps markers with this library.
- shortest distance from a polygon to some point on map
- map.getProjection(...).fromContainerPixelToLatLng is not a function HOT 2
- Google map suddenly stopped loading, white screen appears. HOT 1
- Map Pins are not positioned correctly after zoom or pan HOT 12
- Fitbounds and directionService is not updating markers on the map HOT 1
- Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 'm.nB')
- Card with address on upper left corner
- drag the map when we hover on div card outside the map and it show the that particular marker if marker is hide on centre coardinates HOT 1
- Google together with Visgl and OpenJS has released the official react components for Google maps HOT 4
- need to detect getVisible StreetViewService
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from google-map-react.