Kartograph add character coordinates

I can not add characters to my svg card.

This is the metadata of my svg:

<metadata><views> <view h="720.449987754" padding="0" w="1400"> <proj flip="auto" id="robinson" lon0="-49.8982700875"/> <bbox h="57.01" w="79.24" x="-771.91" y="435.26"/></view></views> </metadata> 

And this is the js code:

 var points_of_interest = [ { name: 'Florianopolis', lat: -27.60, lon: -48.55} ]; map.addSymbols({ type: kartograph.LabeledBubble, data: points_of_interest, location: function(d) { return [d.lon, d.lat] }, title: function(d) { return d.name; }, radius: 3, center: false, attrs: { fill: 'black' }, labelattrs: { 'font-size': 11 }, buffer: true }); 

I don’t know if the coordinates are wrong or the whole code is invalid.

Is there any way to get coordinates from path tags?

Can anybody help me?

0
source share
1 answer

Search for answers I found this question: Kartograph python script generates SVG with wrong lat / long conventions

Then I realized that my svg card with profiling is like robinson. In this projection, the longitudes are different. The map was created with the py mapper, and I did not specify in config.json which type of projection to use. I generated svg again using the 'laea' projection, and now everything is fine.

=)

0
source

Source: https://habr.com/ru/post/958265/


All Articles