Google Maps API Solid State Borders












0















When creating a map, the state borders keep coming up as dashed lines. Is there any way to make them solid? I am working with the province settings in the json but I cannot seem to find a directive for solid line, perhaps in .stroke?










share|improve this question





























    0















    When creating a map, the state borders keep coming up as dashed lines. Is there any way to make them solid? I am working with the province settings in the json but I cannot seem to find a directive for solid line, perhaps in .stroke?










    share|improve this question



























      0












      0








      0








      When creating a map, the state borders keep coming up as dashed lines. Is there any way to make them solid? I am working with the province settings in the json but I cannot seem to find a directive for solid line, perhaps in .stroke?










      share|improve this question
















      When creating a map, the state borders keep coming up as dashed lines. Is there any way to make them solid? I am working with the province settings in the json but I cannot seem to find a directive for solid line, perhaps in .stroke?







      javascript json google-maps google-maps-api-3






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 16 '18 at 21:56









      geocodezip

      128k10148178




      128k10148178










      asked Nov 16 '18 at 11:55









      Jon GlazerJon Glazer

      388215




      388215
























          1 Answer
          1






          active

          oldest

          votes


















          2














          If you can't do it with Styled Maps (and I don't see how you can right now), you could use Styled Maps to hide the state boundaries:



           {
          featureType: 'administrative.province',
          elementType: 'geometry.stroke',
          stylers: [{visibility: '#off'}]
          },


          Then add your own (note that you need a source of the boundaries somewhat consistent with the map tiles).



          Example of using borders from a FusionTable



          proof of concept fiddle



          proof of concept fiddle with styled borders



          screenshot of resulting map



          code snippet:






          function initMap() {
          // Styles a map in night mode.
          var map = new google.maps.Map(document.getElementById('map'), {
          center: {
          lat: 40.674,
          lng: -73.945
          },
          zoom: 7,
          styles: [{
          featureType: 'administrative.province',
          elementType: 'geometry.stroke',
          stylers: [{
          visibility: '#off'
          }]
          }, ]
          });
          var layer = new google.maps.FusionTablesLayer({
          query: {
          select: 'kml_4326',
          from: '19lLpgsKdJRHL2O4fNmJ406ri9JtpIIk8a-AchA'
          },
          map: map
          });
          }

          html,
          body,
          #map {
          height: 100%;
          width: 100%;
          margin: 0;
          padding: 0;
          }

          <div id="map"></div>
          <!-- Replace the value of the key parameter with your own API key. -->
          <script async defer src="https://maps.googleapis.com/maps/api/js?callback=initMap"></script>








          share|improve this answer


























          • This is great! I have never heard of fusion tables. What if I wanted the border to be thicker and blue. That's the last thing I need. It's perfect otherwise.

            – Jon Glazer
            Nov 16 '18 at 18:38






          • 1





            You can style the polylines from FusionTables. (fiddle) Updated answer to include a fiddle with thick blue state borders.

            – geocodezip
            Nov 16 '18 at 21:55














          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53337405%2fgoogle-maps-api-solid-state-borders%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          If you can't do it with Styled Maps (and I don't see how you can right now), you could use Styled Maps to hide the state boundaries:



           {
          featureType: 'administrative.province',
          elementType: 'geometry.stroke',
          stylers: [{visibility: '#off'}]
          },


          Then add your own (note that you need a source of the boundaries somewhat consistent with the map tiles).



          Example of using borders from a FusionTable



          proof of concept fiddle



          proof of concept fiddle with styled borders



          screenshot of resulting map



          code snippet:






          function initMap() {
          // Styles a map in night mode.
          var map = new google.maps.Map(document.getElementById('map'), {
          center: {
          lat: 40.674,
          lng: -73.945
          },
          zoom: 7,
          styles: [{
          featureType: 'administrative.province',
          elementType: 'geometry.stroke',
          stylers: [{
          visibility: '#off'
          }]
          }, ]
          });
          var layer = new google.maps.FusionTablesLayer({
          query: {
          select: 'kml_4326',
          from: '19lLpgsKdJRHL2O4fNmJ406ri9JtpIIk8a-AchA'
          },
          map: map
          });
          }

          html,
          body,
          #map {
          height: 100%;
          width: 100%;
          margin: 0;
          padding: 0;
          }

          <div id="map"></div>
          <!-- Replace the value of the key parameter with your own API key. -->
          <script async defer src="https://maps.googleapis.com/maps/api/js?callback=initMap"></script>








          share|improve this answer


























          • This is great! I have never heard of fusion tables. What if I wanted the border to be thicker and blue. That's the last thing I need. It's perfect otherwise.

            – Jon Glazer
            Nov 16 '18 at 18:38






          • 1





            You can style the polylines from FusionTables. (fiddle) Updated answer to include a fiddle with thick blue state borders.

            – geocodezip
            Nov 16 '18 at 21:55


















          2














          If you can't do it with Styled Maps (and I don't see how you can right now), you could use Styled Maps to hide the state boundaries:



           {
          featureType: 'administrative.province',
          elementType: 'geometry.stroke',
          stylers: [{visibility: '#off'}]
          },


          Then add your own (note that you need a source of the boundaries somewhat consistent with the map tiles).



          Example of using borders from a FusionTable



          proof of concept fiddle



          proof of concept fiddle with styled borders



          screenshot of resulting map



          code snippet:






          function initMap() {
          // Styles a map in night mode.
          var map = new google.maps.Map(document.getElementById('map'), {
          center: {
          lat: 40.674,
          lng: -73.945
          },
          zoom: 7,
          styles: [{
          featureType: 'administrative.province',
          elementType: 'geometry.stroke',
          stylers: [{
          visibility: '#off'
          }]
          }, ]
          });
          var layer = new google.maps.FusionTablesLayer({
          query: {
          select: 'kml_4326',
          from: '19lLpgsKdJRHL2O4fNmJ406ri9JtpIIk8a-AchA'
          },
          map: map
          });
          }

          html,
          body,
          #map {
          height: 100%;
          width: 100%;
          margin: 0;
          padding: 0;
          }

          <div id="map"></div>
          <!-- Replace the value of the key parameter with your own API key. -->
          <script async defer src="https://maps.googleapis.com/maps/api/js?callback=initMap"></script>








          share|improve this answer


























          • This is great! I have never heard of fusion tables. What if I wanted the border to be thicker and blue. That's the last thing I need. It's perfect otherwise.

            – Jon Glazer
            Nov 16 '18 at 18:38






          • 1





            You can style the polylines from FusionTables. (fiddle) Updated answer to include a fiddle with thick blue state borders.

            – geocodezip
            Nov 16 '18 at 21:55
















          2












          2








          2







          If you can't do it with Styled Maps (and I don't see how you can right now), you could use Styled Maps to hide the state boundaries:



           {
          featureType: 'administrative.province',
          elementType: 'geometry.stroke',
          stylers: [{visibility: '#off'}]
          },


          Then add your own (note that you need a source of the boundaries somewhat consistent with the map tiles).



          Example of using borders from a FusionTable



          proof of concept fiddle



          proof of concept fiddle with styled borders



          screenshot of resulting map



          code snippet:






          function initMap() {
          // Styles a map in night mode.
          var map = new google.maps.Map(document.getElementById('map'), {
          center: {
          lat: 40.674,
          lng: -73.945
          },
          zoom: 7,
          styles: [{
          featureType: 'administrative.province',
          elementType: 'geometry.stroke',
          stylers: [{
          visibility: '#off'
          }]
          }, ]
          });
          var layer = new google.maps.FusionTablesLayer({
          query: {
          select: 'kml_4326',
          from: '19lLpgsKdJRHL2O4fNmJ406ri9JtpIIk8a-AchA'
          },
          map: map
          });
          }

          html,
          body,
          #map {
          height: 100%;
          width: 100%;
          margin: 0;
          padding: 0;
          }

          <div id="map"></div>
          <!-- Replace the value of the key parameter with your own API key. -->
          <script async defer src="https://maps.googleapis.com/maps/api/js?callback=initMap"></script>








          share|improve this answer















          If you can't do it with Styled Maps (and I don't see how you can right now), you could use Styled Maps to hide the state boundaries:



           {
          featureType: 'administrative.province',
          elementType: 'geometry.stroke',
          stylers: [{visibility: '#off'}]
          },


          Then add your own (note that you need a source of the boundaries somewhat consistent with the map tiles).



          Example of using borders from a FusionTable



          proof of concept fiddle



          proof of concept fiddle with styled borders



          screenshot of resulting map



          code snippet:






          function initMap() {
          // Styles a map in night mode.
          var map = new google.maps.Map(document.getElementById('map'), {
          center: {
          lat: 40.674,
          lng: -73.945
          },
          zoom: 7,
          styles: [{
          featureType: 'administrative.province',
          elementType: 'geometry.stroke',
          stylers: [{
          visibility: '#off'
          }]
          }, ]
          });
          var layer = new google.maps.FusionTablesLayer({
          query: {
          select: 'kml_4326',
          from: '19lLpgsKdJRHL2O4fNmJ406ri9JtpIIk8a-AchA'
          },
          map: map
          });
          }

          html,
          body,
          #map {
          height: 100%;
          width: 100%;
          margin: 0;
          padding: 0;
          }

          <div id="map"></div>
          <!-- Replace the value of the key parameter with your own API key. -->
          <script async defer src="https://maps.googleapis.com/maps/api/js?callback=initMap"></script>








          function initMap() {
          // Styles a map in night mode.
          var map = new google.maps.Map(document.getElementById('map'), {
          center: {
          lat: 40.674,
          lng: -73.945
          },
          zoom: 7,
          styles: [{
          featureType: 'administrative.province',
          elementType: 'geometry.stroke',
          stylers: [{
          visibility: '#off'
          }]
          }, ]
          });
          var layer = new google.maps.FusionTablesLayer({
          query: {
          select: 'kml_4326',
          from: '19lLpgsKdJRHL2O4fNmJ406ri9JtpIIk8a-AchA'
          },
          map: map
          });
          }

          html,
          body,
          #map {
          height: 100%;
          width: 100%;
          margin: 0;
          padding: 0;
          }

          <div id="map"></div>
          <!-- Replace the value of the key parameter with your own API key. -->
          <script async defer src="https://maps.googleapis.com/maps/api/js?callback=initMap"></script>





          function initMap() {
          // Styles a map in night mode.
          var map = new google.maps.Map(document.getElementById('map'), {
          center: {
          lat: 40.674,
          lng: -73.945
          },
          zoom: 7,
          styles: [{
          featureType: 'administrative.province',
          elementType: 'geometry.stroke',
          stylers: [{
          visibility: '#off'
          }]
          }, ]
          });
          var layer = new google.maps.FusionTablesLayer({
          query: {
          select: 'kml_4326',
          from: '19lLpgsKdJRHL2O4fNmJ406ri9JtpIIk8a-AchA'
          },
          map: map
          });
          }

          html,
          body,
          #map {
          height: 100%;
          width: 100%;
          margin: 0;
          padding: 0;
          }

          <div id="map"></div>
          <!-- Replace the value of the key parameter with your own API key. -->
          <script async defer src="https://maps.googleapis.com/maps/api/js?callback=initMap"></script>






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 16 '18 at 21:55

























          answered Nov 16 '18 at 17:33









          geocodezipgeocodezip

          128k10148178




          128k10148178













          • This is great! I have never heard of fusion tables. What if I wanted the border to be thicker and blue. That's the last thing I need. It's perfect otherwise.

            – Jon Glazer
            Nov 16 '18 at 18:38






          • 1





            You can style the polylines from FusionTables. (fiddle) Updated answer to include a fiddle with thick blue state borders.

            – geocodezip
            Nov 16 '18 at 21:55





















          • This is great! I have never heard of fusion tables. What if I wanted the border to be thicker and blue. That's the last thing I need. It's perfect otherwise.

            – Jon Glazer
            Nov 16 '18 at 18:38






          • 1





            You can style the polylines from FusionTables. (fiddle) Updated answer to include a fiddle with thick blue state borders.

            – geocodezip
            Nov 16 '18 at 21:55



















          This is great! I have never heard of fusion tables. What if I wanted the border to be thicker and blue. That's the last thing I need. It's perfect otherwise.

          – Jon Glazer
          Nov 16 '18 at 18:38





          This is great! I have never heard of fusion tables. What if I wanted the border to be thicker and blue. That's the last thing I need. It's perfect otherwise.

          – Jon Glazer
          Nov 16 '18 at 18:38




          1




          1





          You can style the polylines from FusionTables. (fiddle) Updated answer to include a fiddle with thick blue state borders.

          – geocodezip
          Nov 16 '18 at 21:55







          You can style the polylines from FusionTables. (fiddle) Updated answer to include a fiddle with thick blue state borders.

          – geocodezip
          Nov 16 '18 at 21:55






















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53337405%2fgoogle-maps-api-solid-state-borders%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Bressuire

          Vorschmack

          Quarantine