-
Notifications
You must be signed in to change notification settings - Fork 935
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
markerWithLabel doesn't work at all #604
Comments
I'm getting the same thing. I see on the demo site they are importing css for the marker label so maybe I could try adding my own css somehow on the marker. I will experiment and report back. i'm not a contributor btw |
I found what I was doing wrong, first I need to use some external library like v3-utility-library and pass the MarkerWithLabel function to google-maps-react, and secondly, I was using className on label content instead of class. But i have now another problem too, the labels don't render instantly, i have to reload the map 2-3 times to see them on the map. |
In my case i went for the OverlayView component instead. |
Was introduced by #573 but I can't get it to work as well…… |
@stelro Yes that's the correct way. I sampled on my pr. Also i'm using className too even labelContents are occur from HoCs const ListingMarker = ({listing, onMarkerClick, selectedMarkerIds, outStanding, markerType = "listing"}) => {
return (
<Marker
position={{
lat: listing.map.coordinates.lat,
lng: listing.map.coordinates.lon
}}
key={listing.id}
defaultAnimation={2}
markerWithLabel={window.MarkerWithLabel}
opacity={0}
onClick={() => onMarkerClick(listing)}
labelContent={ReactDOMServer.renderToString(
<MarkerPureBuilder marker={listing}
markerType={markerType}
outStanding={outStanding} />
)}
labelClass={style['map-price-container']}
labelAnchor={new google.maps.Point(35, 27)}
/>
);
}; Instant 50+ makers at the same time but i didn't realize any delay or reload bug. Are you getting this in example or your project ? If it is your code base, maybe there is a flaw in your approach. |
@RGFnaGFuIEd1bmF5
|
|
@RGFnaGFuIEd1bmF5 thank you, I am new to this library and am making use of it. your answer to 3 answers my question. In regards to 1., so is this why my label is invisible? I am putting a Semantic Ui for react component in there instead of raw html and css |
Did you tried |
I've copied verbatim the marker you're using and have google.maps and markerwithlabel as globals and I get the error:
It seems as though somehow the anchor is not properly set? |
I'm having the same issue of @MGHawes with markerwithlabel in window object. |
@CDimonaco Wait #657 for new infrastructure. |
@d46 I tried as you said in pr example for setting labelStyle in a marker. Instead of changing the label color, it returns with an error saying |
@Kanakala This feature does't work at all, wait for new release or put marker with label manually like i did.. So create your marker with label object and attach the map instance from the |
Seriously, there is no way to set style to |
Hi everyone, I figured out a solution for the same. You will need to fork the library until they come up with the new infrastructure. In the
Now, the only nuance is you'll have to pass the
Now in map-marker-icon, you would need to set the css:
I couldn't find a way to override |
Released v9.0.0 |
So there is still not support for label style in marker ? Do you have any roadmap on when is going to be supported ? |
@rahpuser could you just check the new API released in v9.0.0: |
Hello, I am using react-google-maps the last version and I am trying to Implement markerWitLabel, and I don't get any results at all, the markers don't show on the map nor I get any errors in the console. I am using exactly the same code from the example.
Maybe I am missing something? any 3d party library?
The text was updated successfully, but these errors were encountered: