Skip to content

fix: fix layer no appearing issue on android#3051

Merged
mfazekas merged 1 commit intov10.0from
mfazekas/fix-layer-missing-on-android
Sep 14, 2023
Merged

fix: fix layer no appearing issue on android#3051
mfazekas merged 1 commit intov10.0from
mfazekas/fix-layer-missing-on-android

Conversation

@mfazekas
Copy link
Contributor

@mfazekas mfazekas commented Sep 14, 2023

Fixes the following component not rendering on android:

import React from 'react';
import {
  MapView,
  ShapeSource,
  LineLayer,
  Camera,
  VectorSource,
  FillLayer,
} from '@rnmapbox/maps';

//The part which is commeted out works, triggers the on press. The other one doesnt though.

class BugReportExample extends React.Component {
  render() {
    return (
      <MapView style={{ flex: 1 }}>
        <Camera
          centerCoordinate={[11.44274825303006, 49.4026975280301]}
          zoomLevel={14}
        />
        <ShapeSource
          id="polygonSource"
          onPress={() => {
            console.log('pressed');
          }}
          shape={{
            type: 'Feature',
            properties: {},
            geometry: {
              coordinates: [
                [
                  [4.029480413140874, 49.4026975280301],
                  [4.029480413140874, 46.99045121353802],
                  [11.44274825303006, 46.99045121353802],
                  [11.44274825303006, 49.4026975280301],
                  [4.029480413140874, 49.4026975280301],
                ],
              ],
              type: 'Polygon',
            },
          }}
        >
          {/*
            <FillLayer
              id="polygonFill"
              style={{ fillOpacity: 0.6, fillColor: 'blue' }}
            />*/}
        </ShapeSource>
        {
          <FillLayer
            id="polygonFill"
            sourceLayerID="polygonSource"
            sourceID="polygonSource"
            style={{ fillOpacity: 0.6, fillColor: 'blue' }}
          />
        }
      </MapView>
    );
  }
}
export default BugReportExample;

See: #3042

@mfazekas mfazekas merged commit 04ebe10 into v10.0 Sep 14, 2023
@mfazekas mfazekas deleted the mfazekas/fix-layer-missing-on-android branch September 14, 2023 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant