Open FluxxField opened 7 months ago
I've got the same issue. I would also prefer adding support for percentages like you suggested. I'm using a workaround where adding a semicolon ; after the percentage % allows for width and height percentages by terminating the style property before the "px" string is added.
import { GoogleMapsEmbed } from '@next/third-parties/google'
export default function Page() {
return (
<GoogleMapsEmbed
apiKey="XYZ"
height={200}
width="100%;"
mode="place"
q="Brooklyn+Bridge,New+York,NY"
/>
)
}
I've got the same issues too! It only receives height and width parameters values as px
I've got the same issues too! It only receives height and width parameters values as
px
As of right now, the comment above yours is the best solution. Hope that helps for now till this is eventually addressed.
Additional Note: Unfortunately, the Google Maps Embed does not allow us to set a title attribute on the
What is the improvement or update you wish to see?
I would like the documentation for GoogleMapsEmbed to show that the width and height props add "px" to the end of the strings passed to the component.
Is there any context that might help us understand?
Under Third Party Libraries, then under the Google Maps Embed section of the documentation, the example given is the following
As you can see, width is passed a value of "100%". However, this leads to a style of "100%px" on the div element. This is because the component under the hood adds "px" to the end of the height and width strings. The documentation does not reflect this.
Here is a link to the code where this happens.
My request is to either reflect this in the documentation OR to update the component to remove the added "px" to allow for percentages. I would request the latter.
Thank you!
Does the docs page already exist? Please link to it.
https://nextjs.org/docs/app/building-your-application/optimizing/third-party-libraries#google-maps-embed