-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to fit bounds of markers #394
Comments
with
but if but if it's not fit your needs than you may use code in loop of markers;
|
Thanks @cappittall,
But I gave another probelm of Zoom level. Map is getting zoom out when I change markerscdynamically.
How to solve my zoom level? |
Sory for my previous unswer need some generation (As I have seen dom-repeat loop lately)
at this calculateIconType functions, I created my marker object with and added to markers array, Here my function which I try to clear unnecessary codes.
you can see the working code at jobijoy.com |
I have solved my problem but your technique is cool. |
if you're using latest release of the element the attribute is |
It may be easier to solve: just add The full explanation is here. I'll repeat it here: Adding Unfortunately the current example in the google-map component page does not insert this important attribute in each google-map-marker element. Here is the current, without slot="markers" attribute, code example: <google-map latitude="37.77493" longitude="-122.41942" fit-to-markers>
<google-map-marker latitude="37.779" longitude="-122.3892" draggable="true" title="Go Giants!">
</google-map-marker>
<google-map-marker latitude="37.777" longitude="-122.38911">
</google-map-marker>
</google-map> And below is the suggested corrected example that should be shown in the code (if my suggestion is correct): <google-map latitude="37.77493" longitude="-122.41942" fit-to-markers>
<google-map-marker slot="markers" latitude="37.779" longitude="-122.3892" draggable="true" title="Go Giants!">
</google-map-marker>
<google-map-marker slot="markers" latitude="37.777" longitude="-122.38911">
</google-map-marker>
</google-map> What is happening?
Several consequences can happen from this issue: the map can be viewed, but not respond to important events, like fit-to-markers. In these turbulent moves from original without-slots version to the current slotted version (and soon moving to polymer 3.0 version) of the excellent google-map webcomponent, there is a high chance that the busy developers simply forgot to add this important slot="markers" attribute in the example that shows how to add each new google-map-marker webcomponent inside google-map. Please correct me if I made wrong conclusions. You can detect this flaw inspecting your Open Sorry for the long answer. Again: please correct me if I made wrong conclusions. |
I'm drawing markers by iteration. I wanna to fit bounds of those markers but I don't know how to do that by this element.
I have tried the following way:
How can I achieve my goal?
The text was updated successfully, but these errors were encountered: