Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

289
Views
How to change the map (Mapbox) properties with JavaScript?

I have a tableau dashboard that contains a map from Mapbox, the dashboard:

<div class='tableauPlaceholder' id='viz1647788729439' style='position: relative'>
  <noscript>
        <a href='#'>
                <img alt='Dashboard 2 ' src='https:&#47;&#47;public.tableau.com&#47;static&#47;images&#47;YQ&#47;YQD7J4J2T&#47;1_rss.png' 
            style='border: none' />     
        </a>
     </noscript>
  <object class='tableauViz' style='display:none;'><param name='host_url' value='https%3A%2F%2Fpublic.tableau.com%2F' /> 
            <param name='embed_code_version' value='3' /> <param name='path' value='shared&#47;YQD7J4J2T' /> <param name='toolbar' value='yes' />
            <param name='static_image' value='https:&#47;&#47;public.tableau.com&#47;static&#47;images&#47;YQ&#47;YQD7J4J2T&#47;1.png' /> 
            <param name='animate_transition' value='yes' /><param name='display_static_image' value='yes' />
            <param name='display_spinner' value='yes' /><param name='display_overlay' value='yes' />
            <param name='display_count' value='yes' />
            <param name='language' value='en-GB' />
            <param name='filter' value='publish=yes' />
     </object>
</div>
<script type='text/javascript'>
  var divElement = document.getElementById('viz1647788729439');
  var vizElement = divElement.getElementsByTagName('object')[0];
  if (divElement.offsetWidth > 800) {
    vizElement.style.width = '1000px';
    vizElement.style.height = '827px';
  } else if (divElement.offsetWidth > 500) {
    vizElement.style.width = '1000px';
    vizElement.style.height = '827px';
  } else {
    vizElement.style.width = '100%';
    vizElement.style.height = '1477px';
  }
  var scriptElement = document.createElement('script');
  scriptElement.src = 'https://public.tableau.com/javascripts/api/viz_v1.js';
  vizElement.parentNode.insertBefore(scriptElement, vizElement);
</script>

So I want to center the map to Sudan cords lat:12.8628, lng: 30.2176, and zoom to country level then add a polygon of the country's stats Sudan stats polygon then disable the map dragging event so its only shows Sudan

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!