简体   繁体   English

我可以使用自定义样式加载 @react-google-maps/api 上的消息吗

[英]Can I use custom styling for loading message on @react-google-maps/api

I'm using @react-google-maps/api for my app and it works well so far, however, while the map is loading there is a very ugly text that says 'Loading...' displayed instead of a map and I was wondering if I can replace it with a proper loader or at least style the text?我正在为我的应用程序使用 @react-google-maps/api,到目前为止它运行良好,但是,当地图正在加载时,有一个非常难看的文字显示“正在加载...”而不是地图,我想知道我是否可以用合适的加载器替换它或至少设置文本样式?

Screenshot截屏

Pass a ReactNode into the loadingElement prop.ReactNode传递给loadingElement道具。

const Loading = <div /> // change to whatever

<LoadScript
  googleMapsApiKey={googleMapsApiKey}
  ...
  loadingElement={Loading}
>...</LoadScript>

Example 例子

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM