-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Allow specifying info windows and custom icons #14
Conversation
Nice work, but I have a question. Since there's only one info window opened at a time, what happens if we have 3 markers with info windows at the same time when initializing the map? |
The info window only opens when you click on the marker, so having multiple markers with info windows is no problem. If an info window is open and you click on another marker with an info window, the currently open one closes and the new one opens. |
Great. Merging! |
Allow specifying info windows and custom icons
When creating a custom marker, is this the correct way? -- This lives in my Map Controller -- I'm using firefox and the marker itself shows up but is not clickable, no label will show etc. Is something not working or am I doing it wrong? |
Replace "infoWindowContent" with "infoWindow" and it should work. ("label" and "url" are not working yet, see https://github.com/nlaplante/angular-google-maps/blob/master/src/angular-google-maps.js#L195) |
@manuelmeurer thanks for your suggestion, it does work with "infoWindow", but I'd like to know why ? I've checked the angular-google-maps.js and only found "InfoWindowContent", so "InfoWindow" is magic and the only way I found this, was by following your suggestion. I've checked the manual and I'd like to know what I'm missing, so I don't have to relay on you guys all the time or ask silly questions. Any tips is appreciated, thanks for your time! ***** After a couple of minutes I understood why, after reading your pull request ***** So, the reason is here:
the object key is "infoWindow". I just wonder if it isn't better to rename this to InfoWindowContent ? In the moment it doesn't make any difference to me, but my first assumption was InfoWindowContent, instead of InfoWindow that I only found out by reading your comment, or would take me more time to find it in the code. Thanks for your time! |
Well, infoWindowContent is just used internally as the name of the passed parameter AFAICS. I didn't use infoWindow there since I named the variable that holds the actual info window like that. |
@manuelmeurer thanks for your time! You're right docs describing what to do would be much better. |
How can I use a Custom Info Window to apply my layout? There are a way to do this? |
Guys the best thing to do right now is to look here #83 Go down and look where 'epiphany' is stated. That area is how to use InfoWindows most efficiently. If your using Windows then your html content will only be updated when the entire models array is changed. Again if you use Windows... all the InfoWindows are being put into memory even if they are not being viewed. Therefore that is how the idea of tracking activeMarkers came about. Read that thread as there is good stuff there. We will get to the documentation asap.. but right now I am slammed with work. |
Can any one give a tip on adding a custom label using this directive? I tried to add one via the marker object to no avail. var marker = new google.maps.Marker({ position: new google.maps.LatLng(lat, lng), map: _instance, icon: icon, labelContent: "A", labelClass: "labels", // the CSS class for the label labelInBackground: false }); I did it this way just to see if it would at least add "A" to all of them. Was then going to change the |
As mentioned in #13