question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Nativescript Angular 2 issue while using MapBox inside the HTML

See original GitHub issue

The case is the following. I have registered new Element inside the main.ts file using registerElement method.

main.ts file

var map = require("nativescript-mapbox");
registerElement("Map", () => map.Mapbox);

Then I have try to use this element inside my HTML file as follow. app.component.html

<GridLayout>
<Map
    accessToken="ACCESS_TOKEN"
    width="250" 
    height="150"  
    latitude="52.3702160"
    longitude="4.8951680"
    zoomLevel="3"
    mapStyle="light"
    hideAttribution="false"
   showUserLocation="true"
   hideCompass="false"></Map>
</GridLayout>

However on the screen will be show black box even, when the accessToken has been insert. The only way to use this component inside the NS Angular 2 project is to do from code behind, but the Component will be displayed above the other components.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:15

github_iconTop GitHub Comments

1reaction
EddyVerbruggencommented, Nov 17, 2016

That’s great news, thanks for confirming it so quickly! I’ll push 2.3.0 to npm later today so everyone can easily get this fix.

1reaction
EddyVerbruggencommented, Nov 16, 2016

I’ve now applied a similar fix for Android - can you try the latest version from GitHub? Seems to work great with your demo app.

Read more comments on GitHub >

github_iconTop Results From Across the Web

typescript angular 2 · Issue #6 - GitHub
I'm trying to define the Mapbox view with Typescript/Angular2 from HTML. in main.ts. var map = require("natinescript-mapbox"); import ...
Read more >
angular - Mapbox with nativescript | element-registry issue
Could someone help me? I have tried to make an app in NativeScript-Angular using mapbox following This video. In the [Mapbox docs] ...
Read more >
Using A Mapbox In A NativeScript Angular Application
We're going to see how to include Mapbox in our NativeScript Android and iOS mobile application using Angular and TypeScript.
Read more >
https://raw.githubusercontent.com/EddyVerbruggen/n...
[4.4.0](https://github.com/EddyVerbruggen/nativescript-mapbox/tree/4.4.0) ... bugs:** - Nativescript Angular 2 issue while using MapBox inside the HTML ...
Read more >
Fit a map to a bounding box | Mapbox GL JS
This example zooms and pans the map so the new visible area of the map fits within the specified geographical bounds.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found