Comments (10)
Surprised I never ran into this!I can repo it on http://googlewebcomponents.github.io/google-sheets/components/google-sheets/demo.html.
The intention is that the user can still drag the map. Looks like this is from https://github.com/GoogleWebComponents/google-map/blob/master/google-map.html#L668:L669. The lat/lng get updated and updateCenter()
gets called as a result. This calls showCenterMarkerChanged()
explicitly which does the fitToMakers stuff. There was a good reason for that call but I can't recall off the top of my head.
Interested in submitting a PR?
from google-map.
Alright, I've made a PR! It's a simple fix, and it partially solves the issue. It will still explode if showCenterMarker is true, but that's a separate discussion on what you want the behavior to be.
The two are mutually exclusive I think. I mean, you have a marker that's supposed to stay in the center of your map all the time, and if you have other markers on the map that will change the map center position, then you'll get some pretty weird stuff.
I have three recommendations off the top of my head:
- We can make it so that one overrides the other, and mention it in the documentation. e.g. "
fitToMarkers
will overrideshowCenterMarker
, whenever it's set to true." In which case a true value in one will automatically turn the other false. - Throw an error if the two mutually exclusive cases are set to true, and again, mention it in the documentation.
- Do not include the
centerMarker
in calculations forfitToMarkers
. This may sound good and correct, but it's a special case may complicate things, and we may get more weird edge cases from this.
from google-map.
+1
from google-map.
I'm also experiencing the same issue!
map shakes and doesn't allow to drag it (even when zoomed in)
from google-map.
Me too.
Any estimate of if/when this little weirdness might be resolved?
I'm not quite up to the task of fixing it myself, but offer gratitude to anyone who does get it resolved.
from google-map.
To quickly fix this, have a look at google-map.html. There'll be this.updateMarkers();
. Wrap it in a conditional hinged on the existence of centerMarker.
if (this.centerMarker) {
this.updateMarkers();
}
from google-map.
@levitanong I merged your PR. Thanks! I think your #3
makes sense. It may confuse users if the center marker is treated differently, but it's always been more of a convenience than anything else. It also existed before we had proper marker support, so maybe it's time to actually remove it.
from google-map.
Hurrah!
from google-map.
I'd say that #2
is more verbose than #1
(fail fast) and we don't introduce additional complexity as in #3
from google-map.
Works! Thanks very much @levitanong and @ebidel.
from google-map.
Related Issues (20)
- Plans for additional components?
- Google-map-marker: it can't clear it's listeners HOT 1
- icon property broken in google-map-marker HOT 1
- Undefined in _clearListener in google-map-marker HOT 2
- Google-map-marker: Adding more doc for icon property
- google-map-poly can't be created dynamically HOT 4
- google-map-marker component not showing HOT 1
- Polymer lint
- Lowercase m,k,- and some other keyboard keys stop working in the <input> element after opening and touching Google Maps - All platforms HOT 3
- Safari 11.1 a problem repeatedly occured HOT 12
- Impossible to enter chars 'k' or 'm' in any input after dragging the map.. Weird bug. HOT 6
- Copyright notice shown twice when in Shadow DOM
- Map objects persist in memory after component is detached
- google-map-marker: data-binding for *hidden* fails
- html template is missing in google-map HOT 3
- Add label properties to google-map-marker
- Image inside the buttons are being rendered three times HOT 7
- Marker animation DROP and BOUNCE not working in @em-polymer/google-map HOT 1
- Marker info window styles broken HOT 2
- The google-map had no function GetPointAtDistance
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.