jakeoh
Posts: 40
Joined: Tue May 01, 2012 3:18 pm

TopoJSON: Insets to enlarge a portion of a map

Hi,

I tried to use insets to enlarge part of a map - in my case a Quebec province map. After some trial and error, I could make it work, creating an inset of the Laval-Montreal area. The problem is that in this case, unlike insets like Hawaii and Alaska for the US that moves these area to the inset, I would want the original area to stay in the main map and just be reproduced (enlarged) in the inset.

I see that this is normal behaviour from https://api.highcharts.com/highmaps/map ... .geoBounds : "Geometries within this geometry are removed from the default map view and rendered in the inset."

Is there a way around this?
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: TopoJSON: Insets to enlarge a portion of a map

Hello jakeoh!
Thanks for contacting us with your question!

It seems like an uncommon feature. I have forwarded your question to our Highcharts Maps developer and the answer will take slightly longer than normal.

I will be back with your answer ASAP.
Best regards!
Hubert Kozik
Highcharts Developer
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: TopoJSON: Insets to enlarge a portion of a map

Hello jakeoh!
Thanks for your patience.

The feature you are describing sounds like a minimap with zoom to some areas. This cannot be done using insets and geobounds because everything what is defined in geobounds will be transferred from main map to inset. You can see an example here: https://jsfiddle.net/BlackLabel/41u67s0x/ New Mexico is also transferred from the main map, because he is part of inset and geobound.

If you want to create a minimap with an enlarged part of the map you can create a second container for the minimap, so you will have two separate map charts, one as the main map and the second as a minimap with an enlarged part.

Let me know if you need more help.
Best regards!
Hubert Kozik
Highcharts Developer
jakeoh
Posts: 40
Joined: Tue May 01, 2012 3:18 pm

Re: TopoJSON: Insets to enlarge a portion of a map

Thanks. Do you have a jsFiddle example of a minimap that I could use to better understand how to implement this?
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: TopoJSON: Insets to enlarge a portion of a map

jakeoh,
You can check the simple example of two mapCharts with an enlarged part of Hawaii in the bottom chart.

Demo: https://jsfiddle.net/BlackLabel/0h2r63wq/

Feel free to ask any further questions!
Regards!
Hubert Kozik
Highcharts Developer

Return to “Highcharts Maps”