travisredington
Posts: 13
Joined: Tue Dec 11, 2018 2:46 pm

Custom US Map for Angular 6

Hi,

Does anyone know a good source for a US state map to use with Highmaps and Angular 6?

Thanks!
rafalS
Posts: 2665
Joined: Thu Jun 14, 2018 11:40 am

Re: Custom US Map for Angular 6

Hi, travisredington!

Have you looked here? https://code.highcharts.com/mapdata/

API: https://www.highcharts.com/docs/maps/map-collection

Best regards!
Rafal Sebestjanski,
Highcharts Team Lead
travisredington
Posts: 13
Joined: Tue Dec 11, 2018 2:46 pm

Re: Custom US Map for Angular 6

This looks great, thanks!
rafalS
Posts: 2665
Joined: Thu Jun 14, 2018 11:40 am

Re: Custom US Map for Angular 6

You're welcome ;)
Rafal Sebestjanski,
Highcharts Team Lead
travisredington
Posts: 13
Joined: Tue Dec 11, 2018 2:46 pm

Re: Custom US Map for Angular 6

Hey not understanding how to bridge the gap between using these custom map files in JS and in Angular 6. Any ideas?
rafalS
Posts: 2665
Joined: Thu Jun 14, 2018 11:40 am

Re: Custom US Map for Angular 6

Can you specify your question?
Rafal Sebestjanski,
Highcharts Team Lead
travisredington
Posts: 13
Joined: Tue Dec 11, 2018 2:46 pm

Re: Custom US Map for Angular 6

Hi, thanks! Yes, I used NPM install to get all the maps Highcharts is offering ( @highcharts... ). However, I am confused about how to import a specific map ( in this case US state map ) into the Angular 6 environment.

So the specific question is - how do I import and use a US state map for Highmaps in Angular 6?
rafalS
Posts: 2665
Joined: Thu Jun 14, 2018 11:40 am

Re: Custom US Map for Angular 6

travisredington,

Here you can find our whole angular wrapper documentation: https://github.com/highcharts/highcharts-angular
Try to study it first.

In case you have any further questions - I will forward them to our Angular developer (I haven't started to learn it yet) and we will give you a more elaborate answer :)

Best regards!
Rafal Sebestjanski,
Highcharts Team Lead
travisredington
Posts: 13
Joined: Tue Dec 11, 2018 2:46 pm

Re: Custom US Map for Angular 6

This is great! I am so close. I have no errors in loading the map/chart but the map itself does not render.

I see it in the Highcharts object in the console - US map is there. But again it doesn't render.

I looked up some solutions and none of them seem to work yet. Any ideas would be greatly appreciated. Thanks!
travisredington
Posts: 13
Joined: Tue Dec 11, 2018 2:46 pm

Re: Custom US Map for Angular 6

Heh - actually i got it to render and it rendered as a line chart! Is there some boiler plate code for rendering any map with angular? Again, I am using Angular 6
rafalS
Posts: 2665
Joined: Thu Jun 14, 2018 11:40 am

Re: Custom US Map for Angular 6

travisredington,

Have you tried to run this app? https://github.com/highcharts/highchart ... master/src
You have sample demos in it.

For example demo #3 here: https://github.com/highcharts/highchart ... mponent.ts is a map demo.

https://github.com/highcharts/highchart ... r#demo-app
Rafal Sebestjanski,
Highcharts Team Lead
travisredington
Posts: 13
Joined: Tue Dec 11, 2018 2:46 pm

Re: Custom US Map for Angular 6

Thanks again Rafal! will look into it
rafalS
Posts: 2665
Joined: Thu Jun 14, 2018 11:40 am

Re: Custom US Map for Angular 6

Don't hesitate to contact me in case you still have any issues with running that demo. I will then redirect you to our Angular developer.

Best regards!
Rafal Sebestjanski,
Highcharts Team Lead
travisredington
Posts: 13
Joined: Tue Dec 11, 2018 2:46 pm

Re: Custom US Map for Angular 6

That was it! Demo #3! Thanks!
rafalS
Posts: 2665
Joined: Thu Jun 14, 2018 11:40 am

Re: Custom US Map for Angular 6

You're welcome ;) I'm glad you got it!
Rafal Sebestjanski,
Highcharts Team Lead

Return to “Highcharts Maps”