0

I use Leaflet JS, and I need same polygon on a one map

Now: enter image description here

I need:

enter image description here

Thank's for your help!

If I set the noWrap:true on the tileLayer or the worldCopyJump:true I get:

enter image description here

Fiddle – jsfiddle.net/paRxe/5

 var map = L.map('mapId',{
            center: [35.67989, 139.76463],
            zoom: 2,
            // worldCopyJump: true,
            maxZoom: 18,
            minZoom: 1,
            // reuseTiles: true,
            // continuousWorld: trie
            // reuseTiles: true,
            // continuousWorld: true  
            worldCopyJump: true       
          }
        );
5
  • What happens if you set the noWrap option on the tileLayer? Commented Apr 15, 2016 at 12:12
  • I update my question. Commented Apr 15, 2016 at 12:18
  • Can you set up a fiddle? Commented Apr 15, 2016 at 12:19
  • What about worldCopyJump on the map? A jsfiddle would be great too Commented Apr 15, 2016 at 12:21
  • Fiddle – jsfiddle.net/paRxe/5 @CG_FD Commented Apr 15, 2016 at 12:32

1 Answer 1

1

Your 2 polygons are actually part of a multipolygon, forming a single feature.

You could use Turf.js for example, in order to 1) translate one of the part by 360 degrees, and 2) merge those 2 parts. Then record the new feature geometry to replace your current GeoJSON data.

For step 1), you should also be able to use directly Leaflet with latLng.wrap() method.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank's a lot dude for your help!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.