使用react-native-map中的overlayMapTypes功能
P粉253518620
P粉253518620 2023-08-18 14:49:57
0
1
478
<p><ol> <li>圖片重複</li> <li>無法正常運作</li> <li>url磁磚是伺服器端映像</li> <li>同一影像顯示超過100次 這段程式碼是web的,如何在react-native中實現,我正在使用react-native-map</li> </ol> <p><UrlTile maximumZ={ 18 } minimumZ={ 20 } tileSize={256} urlTemplate={imageUrl} opacity={1.0} zIndex={-1} tileCacheMaxAge={20} doubleTileSize={true} flipY={false} /></p> <pre class="brush:php;toolbar:false;">/*** @license * 版權所有 2019 Google LLC。 * SPDX許可證識別碼:Apache-2.0*/ function initMap() { const map = new google.maps.Map(document.getElementById("map"), { zoom: 18, center: { lat: 37.783, lng: -122.403 }, }); const bounds = { 17: [ [20969, 20970], [50657, 50658], ], 18: [ [41939, 41940], [101315, 101317], ], 19: [ [83878, 83881], [202631, 202634], ], 20: [ [167757, 167763], [405263, 405269], ], }; const imageMapType = new google.maps.ImageMapType({ getTileUrl: function (coord, zoom) { console.log("coord",coord) return [ "https://www.gstatic.com/io2010maps/tiles/5/L2_", zoom, "_", coord.x, "_", coord.y, ".png", ].join(""); }, tileSize: new google.maps.Size(256, 256), }); //cosonle.log("imageMapType",imageMapType) map.overlayMapTypes.push(imageMapType); } window.initMap = initMap;</pre> <p>請提供一個在react-native中使用react-native-map的urlTiles的答案</p>
P粉253518620
P粉253518620

全部回覆(1)
P粉665679053

雷雷

熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!