【发布时间】:2017-05-02 10:45:56
【问题描述】:
我使用 google-map-react,我想从 localhost 加载图像,但我遇到了一些问题。这是我的代码:
<GoogleMapReact
onGoogleApiLoaded={({map, maps}) =>
map.mapTypes.set("roadmap", new maps.ImageMapType({
getTileUrl: function (coord, zoom) {
return "http://192.168.1.103/google/" + zoom + "/" + coord.x + "/" + coord.y + ".png"
},
tileSize:new maps.Size(256,256),
name:"GoogleRoadMaps",
maxZoom:18
}))
}
yesIWantToUseGoogleMapApiInternals
defaultCenter={this.props.center}
defaultZoom={this.props.zoom}>
{
this.state.childrenm
}
</GoogleMapReact>
但它不起作用。有什么问题?
【问题讨论】:
标签: google-maps reactjs debugging