Comments (19)
Can you link to a sample which reproduces this?
from google-map.
I believe the problem is related to the fact that the map's container is display: none
initially. From here, the fix is:
google.maps.event.trigger(map, 'resize');
Haven't tested, but we can bake something like this into the map element.
from google-map.
Unfortunately, there's no good way to detect when the parent element of the map becomes visible. I got it working by polling if .offsetParent
was set using rAF callbacks, but that's not ideal. If core-animated-pages were to fire an event, the client can call mapEl.resize()
to ensure the map is displayed properly. That method already has the google.maps.event.trigger(map, 'resize');
trick.
In the general case, mapEl.resize()
will adjust the map to display properly.
from google-map.
Fwiw, this is a common problem and we need to work out a way to inform downstream elements of these kind of changes. I'm reluctant to get into broadcasting, but I don't have any better ideas at the moment.
from google-map.
Are there perf implications of excessive broadcasting you're concerned of?
from google-map.
We almost need a platform primitive to know if an element is in the render tree.
from google-map.
core-animated-pages
now fires the "core-animated-pages-transition-prepare" event when transitions occur: googlearchive/core-animated-pages@e18d5bf
This should do the trick:
animatedPagesEl.addEventListener('core-animated-pages-transition-prepare', function() {
mapsEl.resize();
});
from google-map.
@tobiashutterer we moved this to the GoogleWebComponents org and will be keeping the release version up to date more frequently. You'll get the latest when using the plain bower install GoogleWebComponents/google-map
.
Closing this as the workaround is posted above for the original issue.
from google-map.
I've noticed the same problem when embedding the map in a core-pages element or a core-collapse element. It looks like the map is being translated up and to the left, leaving grey space behind in its wake. The position is not centered in the middle of the map. Also, the map.resize() call is causing the original lat/longs to be shifted.
from google-map.
I have same problem with neon-animated-pages. I can't find som fire like neon-animated-pages-transition-prepare. Is there any solution to display map?
from google-map.
Pull #152 should have fixed this for neon-animated-pages. Have you tried #master
from google-map.
Install master verison helps! Thaks a lot. :)
from google-map.
I still have this bug with neon-animated-pages.
I use this version: "google-map": "GoogleWebComponents/google-map#^1.0.0",
Any help / tips to get this working?
from google-map.
@kingflurkel if you have a test case, I can take a look
from google-map.
EDIT / removed link to very unfinished work
from google-map.
Thanks.
google-map is not getting the iron-resize event. I'll have to dig in to
find out why.
On Thu, Jul 9, 2015 at 11:08 AM, Michael Thuy [email protected]
wrote:
http://actaanbod.bitballoon.com/
Click on the location icon. So I have google-map within
iron-animated-pages.
Code:https://github.com/A-StadLabs/activiteitenaanbod/tree/master/app/elements/a-activiteitenstage
https://github.com/A-StadLabs/activiteitenaanbod/blob/master/app/elements/a-locatie/a-locatie.html
—
Reply to this email directly or view it on GitHub
#33 (comment)
.
from google-map.
Maybe because google-map is in another custom-element, which is in iron-pages?
from google-map.
The problem is in the neon-animated-pages. Because map is inside a custom element, it does not get a notification that it has been shown. Iniside neon-animated-pages:
this.resizerShouldNotify = function(element) {
return element == selectedPage;
}
this.notifyResize();
This should probably be: if element is selectedPage, or its parent is a selected page.
from google-map.
This issue was moved to PolymerElements/neon-animation#57
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.