Google Maps API Solid State Borders
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
add a comment |
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
add a comment |
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
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
javascript json google-maps google-maps-api-3
edited Nov 16 '18 at 21:56
geocodezip
128k10148178
128k10148178
asked Nov 16 '18 at 11:55
Jon GlazerJon Glazer
388215
388215
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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
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>
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
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
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>
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
add a comment |
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
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>
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
add a comment |
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
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>
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
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>
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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