Advanced Markers not showing / Usage with other libraries #179
-
Hello everyone and congrats on the work you guys are doing in this library! This is my first post here, so after carefully making sure that this has not been asked before, I want to ask first of all if this library "plays nice" with other libraries (like for example the older react Google maps libs). What I mean by it is this, can someone use some of this library's components in conjunction with components from other libraries? In my case, I want to use the AdvancedMarker component with one of the older/other react Google maps libs, and if I am not mistaken from the AdvancedMarker's implementation the reason why the Advanced Markers are now showing to my map is because this component gets its map from the context. So, if I don't use the APIContext component I have a problem, right? Any thoughts on this? Your input would be greatly appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
My general assumption would be that it won't work, since every library has their own way to handle objects created with the maps API. Another problem is that every library likely implements some way to load the maps api itself. This conflict will likely lead to errors, problems, or both. One possible exception would be if both libraries use the new That said, most of the magic of this library is in the map component and everything around it is rather simple to implement for any library as long as you can get access to the map instance used. |
Beta Was this translation helpful? Give feedback.
My general assumption would be that it won't work, since every library has their own way to handle objects created with the maps API. Another problem is that every library likely implements some way to load the maps api itself. This conflict will likely lead to errors, problems, or both.
One possible exception would be if both libraries use the new
google.maps.importLibrary()
loader and take care to use an existing loader (like this library does) or otherwise deal with a google maps API that has already been loaded. They would also have to allow communication via the API objects (for example by passing thegoogle.maps.Map
object into a component, which you can get viauseMap()
).That said…