Mapbox ๐Ÿ—บ๏ธ๋กœ ๋งž์ถคํ˜• ์ด๋ ฅ์„œ ๋งต(resumap)์„ ๊ตฌ์ถ•ํ•˜๋Š” ๋ฐฉ๋ฒ•

12453 ๋‹จ์–ด showdevwebdevcareerlearning
Mapbox blog์ด๋ผ๋Š” ์ด๋ฆ„์˜ ๋™๋ฃŒJoe Clark๊ฐ€ DIY Resumap์—์„œ ์žฌ๋ฏธ์žˆ๋Š” ๋งคํ•‘ ํ™œ๋™์„ ๊ต์ฐจ ๊ฒŒ์‹œํ•ฉ๋‹ˆ๋‹ค.

๋ญ? ์žฌ๊ฐœ! ์•Œ๊ฒ ์–ด? ์ด๋ ฅ์„œ ์ง€๋„โ€ฆ
์™œ์š”? ๊ตฐ์ค‘๋“ค ์‚ฌ์ด์—์„œ ๋ˆˆ์— ๋•๋‹ˆ๋‹ค - ๊ทธ๋ฆฌ๊ณ  ์•”์„์„ ๋งคํ•‘ํ•ฉ๋‹ˆ๋‹ค.
์–ด๋–ป๊ฒŒ? ์›น ๋งคํ•‘์— ๋Œ€ํ•œ ์†Œ๊ฐœ๋ฅผ ๋ณด๋ ค๋ฉด ์ด ๋‹จ๊ณ„๋ณ„ ๊ฐ€์ด๋“œ๋ฅผ ๋”ฐ๋ฅด์‹ญ์‹œ์˜ค.

์—ฌ๊ธฐ์—์„œ ๋ฐ๋ชจ๋ฅผ ํ™•์ธํ•˜์‹ญ์‹œ์˜คhttps://mapbox-explorer.github.io/.



1. ๊ณ„์ •์— ๋กœ๊ทธ์ธ



๋ฐฉ๊ธˆ ๊ฐ€์ž…ํ•œ ๊ฒฝ์šฐ Mapbox๋Š” ๋งคํ•‘์„ ์‰ฝ๊ฒŒ ๋งŒ๋“œ๋Š” ์˜คํ”ˆ ์†Œ์Šค ์†Œํ”„ํŠธ์›จ์–ด๋ฅผ ๊ตฌ์ถ•ํ•ฉ๋‹ˆ๋‹ค. 4์ดˆ ์•ˆ์— ๊ท€ํ•˜์˜ ๊ณ„์ • ๋˜๋Š” create a new one์— ๋กœ๊ทธ์ธํ•˜์‹ญ์‹œ์˜ค.

2. Sublime Text ๋˜๋Š” Atom๊ณผ ๊ฐ™์€ ํ…์ŠคํŠธ ํŽธ์ง‘๊ธฐ์— ์œ„์˜ ์ฝ”๋“œ๋ฅผ ๋ณต์‚ฌํ•ฉ๋‹ˆ๋‹ค.



๋Œ€ํ™”์‹ Resumap์„ ๋งŒ๋“ค๊ธฐ ์œ„ํ•ด Mapbox GL JS JavaScript ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์˜ ์ฝ”๋“œ๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. how it works์— ๋Œ€ํ•œ ์ž์„ธํ•œ ๋‚ด์šฉ์„ ์ฝ์–ด๋ณด๊ฑฐ๋‚˜ ์„ฑ๋Šฅ์ด ๋›ฐ์–ด๋‚˜๊ณ  ์ดˆ๋ณด์ž์—๊ฒŒ ์นœ์ˆ™ํ•˜๋‹ค๊ณ  ๋ฏฟ์œผ์…”๋„ ๋ฉ๋‹ˆ๋‹ค. ๐Ÿ™‚ "fly to a location based on scroll position"์—์„œ Resumap ์ฝ”๋“œ๋ฅผ ๋งž์ถคํ™”ํ–ˆ์Šต๋‹ˆ๋‹ค.

์›น ์‚ฌ์ดํŠธ ๊ตฌ์ถ• ๊ฒฝํ—˜์ด ์žˆ๋Š” ๊ฒฝ์šฐ ์ด ์Šค๋‹ˆํŽซ์„ ์ž์œ ๋กญ๊ฒŒ ๋ณต์‚ฌํ•˜๊ณ  ์ž์‹ ์˜ ์•ก์„ธ์Šค ํ† ํฐ์„ ์ถ”๊ฐ€ํ•˜๊ณ  ์›ํ•˜๋Š” ๊ณณ์—์„œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์›น ๊ฐœ๋ฐœ์ด ์ฒ˜์Œ์ด๊ฑฐ๋‚˜ ์ฝ”๋”ฉ ๊ฒฝํ—˜์ด ๋งŽ์ง€ ์•Š๋‹ค๋ฉด ํ•จ๊ป˜ ์ฝ์–ด๋ณด์„ธ์š”!

<!DOCTYPE html>
<html>
<head>
    <meta charset='utf-8' />
    <title></title>
    <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
    <script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.44.1/mapbox-gl.js'></script>
    <link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.44.1/mapbox-gl.css' rel='stylesheet' />
    <style>
        body { margin:0; padding:0; }
        #map { position:absolute; top:0; bottom:0; width:100%; }
    </style>
</head>
<body>

<style>
#map {
    position: fixed;
    width:50%;
}
#features {
    width: 50%;
    margin-left: 50%;
    font-family: Tw Cen MT;
    overflow-y: scroll;
    background-color: #fafafa;
}
section {
    padding:  25px 50px;
    line-height: 25px;
    border-bottom: 1px solid #ddd;
    opacity: 0.25;
    font-size: 20px;
}
section.active {
    opacity: 1;
}
section:last-child {
    border-bottom: none;
    margin-bottom: 1000px;
}
</style>

<div id='map'></div>
<div id='features'>
    <section id='welcome' class='active'>
        <h3>Hey, there!</h3>
        <p>Welcome to a resumap! A resume can only say so much. <br><br>๐Ÿค– And they tend to feel robotic, don't they? <br><br>Resumaps are designed to fill the gaps in your resume. If you want to stand out, a resumap is a fun way to help people get to know you. After all, wouldn't you want to know who you're hiring? So if you want see more, sit back, relax, and enjoy the flight ๐Ÿš€</p>
    </section>
    <section id='section1' class='active'>
        <h3>Section 1</h3>
        <p>Here's where you can add a narrative to take your resume to the next level. Where did you come from? What really brought you there? What made you leave? This is to let people get a glimpse of who the person behind the paper is. This is New Mexico...but you can center your map however you want.
    </section>
    <section id='section2'>
        <h3>Section 2</h3>
        <p>As your readers scroll through these sections, your resumap will fly them to the locations you've specified. A sense of place is something that a lot of people resonate with. Where you were when you did what you did is half of the story.<br><br>Add some line breaks to start a new paragraph if you want to feel fancy.</p>
    </section>
    <section id='section3'>
        <h3>Section 3</h3>
        <p>You can add pictures! <br><br> <img src="https://i.imgur.com/NF8af.jpg"><br><br></p>
    </section>
    <section id='section4'>
        <h3>Section 4</h3>
        <p>Or even gifs! <br><br><iframe src="https://giphy.com/embed/fpXxIjftmkk9y" width="224" height="240" frameBorder="0" class="giphy-embed" allowFullScreen></iframe><p></p>
        </p>
    </section>
    <section id='section5'>
        <h3>Section 5</h3>
        <p>Or videos! WHAT!<br><br><iframe width="560" height="315" src="https://www.youtube.com/embed/le0BLAEO93g" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe> </p>
    </section>
    <section id='section6'>
        <h3>Section 6</h3>
        <p>The most important thing is to tell <i>your</i> story. What makes you you?</p>
    </section>
    <section id='section7'>
        <h3>Time to make your own</h3>
        <p>Have fun!<br><br><iframe src="https://giphy.com/embed/lJNoBCvQYp7nq" width="300" height="300" frameBorder="0" class="giphy-embed" allowFullScreen></iframe><p></p></p>
    </section>
</div>
<script>
mapboxgl.accessToken = 'PASTE YOUR ACCESS TOKEN HERE';
var map = new mapboxgl.Map({
    container: 'map',
    style: 'mapbox://styles/mapbox/outdoors-v10',
        bearing: -0,
        center: [-108.866174, 49.272291],
        zoom: 2,
        speed: 0.8,
        pitch: 0
});
var chapters = {
    'welcome': {
        bearing: -0,
        center: [-108.866174, 49.272291],
        zoom: 2,
        speed: 0.8,
        pitch: 0
    },
    'section1': {
        bearing: 0,
        center: [-105.391504, 34.371086],
        zoom: 6.00,
        pitch: 0
    },
    'section2': {
        center: [-122.316235, 47.605958],
        bearing: 54.40,
        zoom: 12.59,
        speed: 0.6,
        pitch: 44.50
    },
    'section3': {
        bearing: 12.80,
        center: [-0.075681, 51.498018],
        zoom: 13.18,
        speed: 0.6,
        pitch: 0.00
    },
    'section4': {
        bearing: 60,
        center: [-134.408720, 58.300388],
        zoom: 16.57,
        speed: 0.6,
        pitch: 45
    },
    'section5': {
        bearing: 15.20,
        center: [29.027289, 41.013899],
        zoom: 10.56,
        pitch: 40.50,
        speed: 0.6
    },
    'section6': {
        bearing: 0,
        center: [-63.594167, -17.701427],
        zoom: 5.53,
        pitch: 0,
        speed: 0.6
    },
    'section7': {
        bearing: -0,
        center: [27.230526, 0.000000],
        zoom: 1.18,
        speed: 0.8,
        pitch: 0
    },
};
// On every scroll event, check which element is on screen
window.onscroll = function() {
    var chapterNames = Object.keys(chapters);
    for (var i = 0; i < chapterNames.length; i++) {
        var chapterName = chapterNames[i];
        if (isElementOnScreen(chapterName)) {
            setActiveChapter(chapterName);
            break;
        }
    }
};
var activeChapterName = 'baker';
function setActiveChapter(chapterName) {
    if (chapterName === activeChapterName) return;
    map.flyTo(chapters[chapterName]);
    document.getElementById(chapterName).setAttribute('class', 'active');
    document.getElementById(activeChapterName).setAttribute('class', '');
    activeChapterName = chapterName;
}
function isElementOnScreen(id) {
    var element = document.getElementById(id);
    var bounds = element.getBoundingClientRect();
    return bounds.top < window.innerHeight && bounds.bottom > 0;
}
</script>
</body>
</html>

3. ๊ณ„์ •์—์„œ ์•ก์„ธ์Šค ํ† ํฐ ์ถ”๊ฐ€



account dashboard ์ƒ๋‹จ์— ์žˆ๋Š” ์•ก์„ธ์Šค ํ† ํฐ์„ ๋ณต์‚ฌํ•˜์—ฌ ์ฝ”๋“œ์— ๋‹ค์Œ๊ณผ ๊ฐ™์ด ๋ถ™์—ฌ๋„ฃ์Šต๋‹ˆ๋‹ค.

mapboxgl.accessToken = 'PASTE YOUR ACCESS TOKEN HERE';

์•„ํฌ์ŠคํŠธ๋กœํ”ผ๋ฅผ ์œ ์ง€ํ•˜์‹ญ์‹œ์˜ค!

4. ์ง€๋„ ๋ฐฐ์น˜



์ด๋ ฅ์„œ๊ฐ€ ์‹œ์ฒญ์ž๊ฐ€ ํ˜„์žฌ ์ฝ๊ณ  ์žˆ๋Š” ์œ„์น˜์˜ ์ค‘์•™์— ์˜ค๊ธธ ์›ํ•  ๊ฒƒ์ž…๋‹ˆ๋‹ค. Mapbox Studio์˜ Style Editor์— ์žˆ๋Š” Map position ๋ฉ”๋‰ด๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ํ•„์š”ํ•œ ์ •ํ™•ํ•œ longitude , latitude , zoom , bearing ๋ฐ pitch ๋ฅผ ์–ป์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.



ํ…์ŠคํŠธ ํŽธ์ง‘๊ธฐ๋กœ ๋Œ์•„๊ฐ€๋ฉด ์ฝ”๋“œ์˜ ์ง€๋„ ์œ„์น˜ ์ „์šฉ ์„น์…˜์ด ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค. ์—ฌ๊ธฐ์—์„œ ํ™•๋Œ€/์ถ•์†Œ ์ˆ˜์ค€, ๊ฒฝ๋„, ์œ„๋„, ํ”ผ์น˜ ๋ฐ ๋ฒ ์–ด๋ง์„ ์ž…๋ ฅํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

var chapters = {
    'welcome': {
        bearing: -0,
        center: [-108.866174, 49.272291],
        zoom: 2,
        speed: 0.8,
        pitch: 0
    },
    'place1': {
        center: [-71.007520, 42.340921],
        bearing: -150,
        zoom: 16.72,
        speed: 0.6,
        pitch: 45
    },
    'place2': {
        bearing: -45,
        center: [-68.899502, 46.030150],
        zoom: 15.99,
        speed: 0.6,
        pitch: 45
    }
};

๋ถ„์„์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.
  • center๋Š” ์ง€๋„ ์œ„์น˜ ๋„๊ตฌ
  • ๋กœ ์ฐพ์€ ๊ฒฝ๋„์™€ ์œ„๋„(์ˆœ์„œ๋Œ€๋กœ)์ž…๋‹ˆ๋‹ค.
  • speed๋Š” ์ด๋ ฅ์„œ๊ฐ€ ํ•ด๋‹น ์œ„์น˜
  • ๋กœ ๋‚ ์•„๊ฐ€๋Š” ์†๋„์ž…๋‹ˆ๋‹ค.
  • ๋™์ผํ•œ ํ˜•์‹์„ ๋”ฐ๋ผ ์›ํ•˜๋Š” ๋งŒํผ ์žฅ์†Œ๋ฅผ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค
  • .
  • fly to ํ•จ์ˆ˜๊ฐ€ ์›ํ•˜๋Š” ๋Œ€๋กœ ์ž‘๋™ํ•˜๋„๋ก ์ˆซ์ž๋ฅผ ๊ฐ€์ง€๊ณ  ๋†€์•„ ๋ณด์‹ญ์‹œ์˜ค. ๋…์ž๊ฐ€ ์ด๋ ฅ์„œ์—์„œ ๋‹ค์Œ ์„น์…˜(๋˜๋Š” chapter )์œผ๋กœ ์Šคํฌ๋กคํ•˜๋ฉด ์ง€์ •ํ•œ ์œ„์น˜๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค.

  • 5. ์ž์‹ ์˜ ์›น์‚ฌ์ดํŠธ์— ์ง€๋„ ๊ฒŒ์‹œ



    ์ด๋ฏธ ์•ฝ๊ฐ„์˜ ๊ฐ€๋ฒผ์šด ์ฝ”๋”ฉ ๊ฒฝํ—˜์ด ์žˆ๋‹ค๋ฉด ์–ธ์ œ๋“ ์ง€ ์ด๋ ฅ์„œ๋ฅผ ๊ฒŒ์‹œํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์›น ์‚ฌ์ดํŠธ ๊ตฌ์ถ• ๊ฒฝํ—˜์ด ์—†๋”๋ผ๋„ ๊ดœ์ฐฎ์Šต๋‹ˆ๋‹ค. GitHub ์›น ๊ฐœ๋ฐœ์„ ์‰ฝ๊ฒŒ ์‹œ์ž‘ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค!
  • my personal resumap ์˜ ๊ฒฝ์šฐ GitHub Pages๋กœ ์›น์‚ฌ์ดํŠธ๋ฅผ ๊ตฌ์ถ•ํ•˜๊ธฐ ์œ„ํ•ด GitHubโ€™s tutorial์„ ํŒ”๋กœ์šฐํ–ˆ์Šต๋‹ˆ๋‹ค.
  • ์ดˆ๋ณด์ž๋ฅผ ์œ„ํ•ด GitHub์˜ ์ž์Šต์„œ๋Š” URL์ด ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๋ฌด๋ฃŒ ์›น ์‚ฌ์ดํŠธ๋กœ ์‹œ์ž‘ํ•˜๊ณ  ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•ฉ๋‹ˆ๋‹ค. **https://** ***username*** **.github.io**

  • 3๋‹จ๊ณ„์™€ 4๋‹จ๊ณ„์—์„œ ์ž‘์—…ํ•œ ์ฝ”๋“œ๋ฅผ index.html ํŒŒ์ผ๋กœ ์ถ”๊ฐ€ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

    6. ๋งŒ๋“  ๊ฒƒ์„ ๊ณต์œ ํ•ฉ๋‹ˆ๋‹ค.





  • ์ด์ œ ์ด๋ ฅ์„œ๊ฐ€ ์ค€๋น„๋˜์–ด ์‹คํ–‰ ์ค‘์ด๋ฏ€๋กœ ์„ธ์ƒ๊ณผ ๊ณต์œ ํ•  ์‹œ๊ฐ„์ž…๋‹ˆ๋‹ค. ๊ฐœ์ธ ํฌํŠธํด๋ฆฌ์˜ค์— ์‚ฌ์šฉํ•˜๊ฑฐ๋‚˜ ์ž ์žฌ์ ์ธ ๊ณ ์šฉ์ฃผ์—๊ฒŒ ๋ณด๋‚ด๊ฑฐ๋‚˜ ์ปค๋ฒ„๋ ˆํ„ฐ ๋Œ€์‹  ์ œ๊ณตํ•˜์‹ญ์‹œ์˜ค. @Mapbox #builtwithmapbox๋ฅผ ํŠธ์œ—ํ•˜์—ฌ ์ž๋ž‘ํ•˜์„ธ์š”.



    ์ถ”๊ฐ€ ํฌ๋ ˆ๋”ง - ์„ ํƒ์  ์‚ฌ์šฉ์ž ์ •์˜



    ์ด๋ ฅ์„œ๊ฐ€ ๋งˆ์Œ์— ๋“œ๋Š”๋ฐ ๋ ˆ๋ฒจ์—…์„ ์›ํ•˜์‹œ๋‚˜์š”? ํ”„๋กœ ๋ฌด๋ธŒ -

    ์ปค์Šคํ…€ ์Šคํƒ€์ผ ๐ŸŽจ
  • "์ด ์Šคํƒ€์ผ ์ถ”๊ฐ€"
  • ๋ฅผ ํด๋ฆญํ•˜์—ฌ ๊ณ„์ •์— designer map style์„ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.
  • ๋˜๋Š” Cartogram์œผ๋กœ ๋‚˜๋งŒ์˜ ์Šคํƒ€์ผ์„ ๋งŒ๋“ค๊ณ  ์‚ฌ์ง„
  • ์„ ๋Œ์–ด๋‹ค ๋†“์Šต๋‹ˆ๋‹ค.
  • Styles page์—์„œ ์ด๋Ÿฌํ•œ ํ•ญ๋ชฉ์„ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. "๊ฐœ๋ฐœ ๋ฐ ์‚ฌ์šฉ ๊ณต์œ "๋ฅผ ํด๋ฆญํ•˜์‹ญ์‹œ์˜ค
  • .

    ๋งž์ถค ์•„์ด์ฝ˜ โœจ
  • ์ง€๋„ ์•„์ด์ฝ˜์œผ๋กœ ๋งค์šฐ ์ฐฝ์˜์ ์ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. Inkscape์„ ์‚ฌ์šฉํ•˜์—ฌ ๋น„ํŠธ๋ชจ์ง€ ์–ผ๊ตด์„ .svg ์•„์ด์ฝ˜์œผ๋กœ ๋งŒ๋“ค๊ณ  Mapbox Studio์— ์—…๋กœ๋“œํ–ˆ์Šต๋‹ˆ๋‹ค
  • .
  • ์ด ํŠœํ† ๋ฆฌ์–ผhttps://www.mapbox.com/help/markers/์—์„œ .svg ํŒŒ์ผ์„ Mapbox Studio์— ์—…๋กœ๋“œํ•˜๊ณ  ์ง€๋„์˜ ๋งˆ์ปค๋กœ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
  • ์˜๊ฐ์„ ์–ป์œผ๋ ค๋ฉด marker playground์„ ํ™•์ธํ•˜์‹ญ์‹œ์˜ค
  • .

    ์งˆ๋ฌธ์„ ๋Œ“๊ธ€๋กœ ๋‚จ๊ฒจ์ฃผ์‹œ๊ฑฐ๋‚˜ ํŠธ์œ„ํ„ฐ์—์„œ @Mapbox๋ฅผ ๋ˆŒ๋Ÿฌ์ฃผ์„ธ์š” :)

    ์ข‹์€ ์›นํŽ˜์ด์ง€ ์ฆ๊ฒจ์ฐพ๊ธฐ