AdvancedReactNative
AdvancedReactNative copied to clipboard
Super experssion must either be null or a function - Mapbox
import React, {Componet} from 'react'; import MapboxGL from '@react-native-mapbox-gl/maps';
MapboxGL.accessToken = 'pk.eyJ1IjoicG1hcnJlcm8iLCJhIjoiY2s0eW1vNno0MDI3YzNucG9jOGdzOWJmZiJ9.59Mq2rt899naM6nylQ9jeA';
export default class WMS extends Componet{ redner(){ const map = new MapboxGL.Map({ container: 'map', style: 'mapbox://styles/mapbox/light-v10', zoom: 8, center: [-74.5447, 40.6892] }); map.on('load', function() { map.addLayer( { 'id': 'wms-test-layer', 'type': 'raster', 'source': { 'type': 'raster', 'tiles': [ 'https://img.nj.gov/imagerywms/Natural2015?bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&srs=EPSG:3857&transparent=true&width=256&height=256&layers=Natural2015' ], 'tileSize': 256 }, 'paint': {} }, 'aeroway-line' ); }); return
"Componet" and "redner" are looking awful weird (they should be Component and render). Can you fix those and try again? (including the "Componet" import from 'react'). Also, it's always helpful for others if you can format your code before submitting it, so that people can read it more easily. :)