Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geojson layer disappears after changing the Map Style url #290

Closed
jxlstudio opened this issue Feb 23, 2021 · 3 comments
Closed

Geojson layer disappears after changing the Map Style url #290

jxlstudio opened this issue Feb 23, 2021 · 3 comments
Assignees
Labels
duplicate This issue or pull request already exists

Comments

@jxlstudio
Copy link

I have a dropdown that changed the map style on change, but whenever I update the style, the boundaries of the outline (Geojson layer) I have pre-drawn disappears. Tried adding a watcher to add the layer back after the style changes, but did not work.

<MglMap :accessToken="accessToken" :mapStyle.sync="mapStyleUrl" :center="centerCoords" :bearing="bearing" :zoom="zoom" :scrollZoom="scrollZoom" :repaint="repaint" container="map" :preserveDrawingBuffer="true" @load="onMapLoad" @mouseup="onMapMove()" logoPosition="bottom-right">
            <MglNavigationControl :compact="compact" position="top-right"/>
            <MglFullscreenControl :compact="compact" position="bottom-right"/>
            <!-- <MglMarker :coordinates="centerCoords"></MglMarker> -->
            <MglMarker v-for="(pin, index) in mapPins" :coordinates="pin.coords" :key="pin.id" draggable @dragend="updatePinCoords" :ref="index">
              <MglPopup :offset="popupOffset">
                <div class="pa-4">
                  <p>{{pin.name}}</p>
                  <p>{{pin.id}}</p>
                  <p>{{pin.coords}}</p>
                  <v-btn @click="deleteMapPin(pin.id)">Delete Pin</v-btn>
                </div>
              </MglPopup>
            </MglMarker>
            <MglGeojsonLayer
              :sourceId="mapLines.data.id"
              :source="mapLines"
              layerId="lines"
              :layer="mapLinesLayer"
            ></MglGeojsonLayer>
        </MglMap>
@jxlstudio
Copy link
Author

Any thoughts or updates here? @deepak-geospoc

@vinayakkulkarni vinayakkulkarni self-assigned this Jul 6, 2021
@vinayakkulkarni vinayakkulkarni added the duplicate This issue or pull request already exists label Jul 6, 2021
@vinayakkulkarni
Copy link
Owner

I'll create a codesandbox which provides a workaround cause this is a bug within Mapbox itself ref: mapbox/mapbox-gl-js#4006 (comment)

@vinayakkulkarni
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants