-
Notifications
You must be signed in to change notification settings - Fork 143
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
Base Map sizing #74
Comments
I am facing the exact same problem and I had to add I noticed that in the docs you have something about the Canvaslayer which is nowhere in the TOC I only got access to it by using the search feature in the docs then I tried to use that component like so: <map-box
:accessToken="token"
:mapStyle.sync="mapStyle"
:RTLTextPluginUrl="mapRTL()"
@load="onMapLoaded"
>
<map-canvas :coordinates="coordinates"/>
</map-box> import { MglMap, MglCanvasLayer } from 'vue-mapbox'
@Component({
components: {
'map-box': MglMap,
'map-canvas': MglCanvasLayer,
},
})
export default class Map extends Vue {
// the rest of the code....
} But I am receiving a few errors: also, I am not sure if I am on something here or my approach is completely wrong |
@anandbaskaran i have solved this issue by doing the following workaround .mgl-map-wrapper {
height: 100% !important;
}
.mapboxgl-map {
overflow: visible;
height: 100% !important;
}
.mapboxgl-canvas {
height: 100% !important;
} then to fix the stretching of the map i resize the window programmatically (i am using electron) import { remote } from 'electron'
// somewhere in your vue component...
private onMapLoaded() {
// resizing the window to help the map resize
remote
.getCurrentWindow()
.setSize(
remote.getCurrentWindow().getSize()[0] + 1,
remote.getCurrentWindow().getSize()[1] + 1
)
} hope it helps |
I tried to add sane default sizing in version 0.1.4. |
I just followed the instructions and the good thing is, the library worked with ease!
However, firstly, for some reason I could not see the map due to the overflow. I resolve this by having:
Secondly, the height of the map (canvas) seem to be fixed to 375px. I again tried to have the customized height like below:
But the output looks like this:
Can you please help me fixing this issue.?
The text was updated successfully, but these errors were encountered: