Adding GeoJSON tile set to an existing map The Next CEO of Stack OverflowQuerying PostgreSQL with GIS to get GeoJSON for GeoJSON tile layer?mapbox.js 1.6.2 - change tile set on zoom levelsAdding custom web tile layer to ArcMap?MapBox GL geoJSON markers disappear when custom style loadedError with Leaflet Tutorial on adding Mapbox tile layerAdding Horizon and Sky to a Pokemon Go-like Map?Generating perfect tile set from Mapbox for given zoom level?Adding GeoJSON layer on leaflet?Adding new layer to existing User Stored Display in ArcFM?Adding customized basemap ArcGIS vector tile to QGIS

What makes a siege story/plot interesting?

Why does standard notation not preserve intervals (visually)

Error when running sfdx update to 7.1.3 then sfdx push errors

Why do professional authors make "consistency" mistakes? And how to avoid them?

Is it safe to use c_str() on a temporary string?

WOW air has ceased operation, can I get my tickets refunded?

What is meant by a M next to a roman numeral?

How to make a variable always equal to the result of some calculations?

How easy is it to start Magic from scratch?

What's the point of interval inversion?

How can I get through very long and very dry, but also very useful technical documents when learning a new tool?

How do scammers retract money, while you can’t?

When airplanes disconnect from a tanker during air to air refueling, why do they bank so sharply to the right?

Can a caster that cast Polymorph on themselves stop concentrating at any point even if their Int is low?

Is it a good idea to use COLUMN AS (left([Another_Column],(4)) instead of LEFT in the select?

How do I get the green key off the shelf in the Dobby level of Lego Harry Potter 2?

Why didn't Theresa May consult with Parliament before negotiating a deal with the EU?

What is the point of a new vote on May's deal when the indicative votes suggest she will not win?

What is the purpose of the Evocation wizard's Potent Cantrip feature?

% symbol leads to superlong (forever?) compilations

What can we do to stop prior company from asking us questions?

What do "high sea" and "carry" mean in this sentence?

Does it take more energy to get to Venus or to Mars?

Why did we only see the N-1 starfighters in one film?



Adding GeoJSON tile set to an existing map



The Next CEO of Stack OverflowQuerying PostgreSQL with GIS to get GeoJSON for GeoJSON tile layer?mapbox.js 1.6.2 - change tile set on zoom levelsAdding custom web tile layer to ArcMap?MapBox GL geoJSON markers disappear when custom style loadedError with Leaflet Tutorial on adding Mapbox tile layerAdding Horizon and Sky to a Pokemon Go-like Map?Generating perfect tile set from Mapbox for given zoom level?Adding GeoJSON layer on leaflet?Adding new layer to existing User Stored Display in ArcFM?Adding customized basemap ArcGIS vector tile to QGIS










0















I'm confused on how to add my GeoJSON tileset to an existing map built with a default style. Do I add the GeoJSON by ID or by style? Here is what I'm working with now.l



Added .geojson to Tilesets as FCC_States2_4326-7v9iga
ID = mmcinnis.crxr86ot



style made with tileset:
mapbox://styles/mmcinnis/cjtroguqv0t8s1fqjo9o5rwvy



 <script>
mapboxgl.accessToken = 'pk.eyJ1IjoibW1ja...';
var map = new mapboxgl.Map(
container: 'map',
style: 'mapbox://styles/mapbox/light-v10',
//style: 'mapbox://styles/mmcinnis/cjtroguqv0t8s1fqjo9o5rwvy',
center: [-99.9, 41.5],
zoom: 1
);

map.on('load', function ()
map.addSource("fcc-states2-4326",
type: "geojson",
data: "mapbox://styles/mmcinnis/cjtroguqv0t8s1fqjo9o5rwvy"
)

map.addLayer(
'id': 'example',
'type': 'fill',
'source': "fcc-states2-4326",
'layout': ,
'paint':
'fill-color': '#088',
'fill-opacity': 0.8

);
);
</script>









share|improve this question
























  • OK, I found some documentation and I think I'm close but the debugger shows 422 (Unknown) map.addSource("fcc-states2-4326", type: "vector", url: "api.mapbox.com/datasets/v1/mmcinnis/…..." )

    – user2084255
    7 hours ago












  • Had to add source-layer... map.addLayer( 'id': 'mmcinnis.crxr86ot', 'type': 'fill', 'source': "fcc-states2-4326", "source-layer": "fcc-states2-4326", 'layout': , 'paint': 'fill-color': '#088', 'fill-opacity': 0.8 );

    – user2084255
    7 hours ago















0















I'm confused on how to add my GeoJSON tileset to an existing map built with a default style. Do I add the GeoJSON by ID or by style? Here is what I'm working with now.l



Added .geojson to Tilesets as FCC_States2_4326-7v9iga
ID = mmcinnis.crxr86ot



style made with tileset:
mapbox://styles/mmcinnis/cjtroguqv0t8s1fqjo9o5rwvy



 <script>
mapboxgl.accessToken = 'pk.eyJ1IjoibW1ja...';
var map = new mapboxgl.Map(
container: 'map',
style: 'mapbox://styles/mapbox/light-v10',
//style: 'mapbox://styles/mmcinnis/cjtroguqv0t8s1fqjo9o5rwvy',
center: [-99.9, 41.5],
zoom: 1
);

map.on('load', function ()
map.addSource("fcc-states2-4326",
type: "geojson",
data: "mapbox://styles/mmcinnis/cjtroguqv0t8s1fqjo9o5rwvy"
)

map.addLayer(
'id': 'example',
'type': 'fill',
'source': "fcc-states2-4326",
'layout': ,
'paint':
'fill-color': '#088',
'fill-opacity': 0.8

);
);
</script>









share|improve this question
























  • OK, I found some documentation and I think I'm close but the debugger shows 422 (Unknown) map.addSource("fcc-states2-4326", type: "vector", url: "api.mapbox.com/datasets/v1/mmcinnis/…..." )

    – user2084255
    7 hours ago












  • Had to add source-layer... map.addLayer( 'id': 'mmcinnis.crxr86ot', 'type': 'fill', 'source': "fcc-states2-4326", "source-layer": "fcc-states2-4326", 'layout': , 'paint': 'fill-color': '#088', 'fill-opacity': 0.8 );

    – user2084255
    7 hours ago













0












0








0








I'm confused on how to add my GeoJSON tileset to an existing map built with a default style. Do I add the GeoJSON by ID or by style? Here is what I'm working with now.l



Added .geojson to Tilesets as FCC_States2_4326-7v9iga
ID = mmcinnis.crxr86ot



style made with tileset:
mapbox://styles/mmcinnis/cjtroguqv0t8s1fqjo9o5rwvy



 <script>
mapboxgl.accessToken = 'pk.eyJ1IjoibW1ja...';
var map = new mapboxgl.Map(
container: 'map',
style: 'mapbox://styles/mapbox/light-v10',
//style: 'mapbox://styles/mmcinnis/cjtroguqv0t8s1fqjo9o5rwvy',
center: [-99.9, 41.5],
zoom: 1
);

map.on('load', function ()
map.addSource("fcc-states2-4326",
type: "geojson",
data: "mapbox://styles/mmcinnis/cjtroguqv0t8s1fqjo9o5rwvy"
)

map.addLayer(
'id': 'example',
'type': 'fill',
'source': "fcc-states2-4326",
'layout': ,
'paint':
'fill-color': '#088',
'fill-opacity': 0.8

);
);
</script>









share|improve this question
















I'm confused on how to add my GeoJSON tileset to an existing map built with a default style. Do I add the GeoJSON by ID or by style? Here is what I'm working with now.l



Added .geojson to Tilesets as FCC_States2_4326-7v9iga
ID = mmcinnis.crxr86ot



style made with tileset:
mapbox://styles/mmcinnis/cjtroguqv0t8s1fqjo9o5rwvy



 <script>
mapboxgl.accessToken = 'pk.eyJ1IjoibW1ja...';
var map = new mapboxgl.Map(
container: 'map',
style: 'mapbox://styles/mapbox/light-v10',
//style: 'mapbox://styles/mmcinnis/cjtroguqv0t8s1fqjo9o5rwvy',
center: [-99.9, 41.5],
zoom: 1
);

map.on('load', function ()
map.addSource("fcc-states2-4326",
type: "geojson",
data: "mapbox://styles/mmcinnis/cjtroguqv0t8s1fqjo9o5rwvy"
)

map.addLayer(
'id': 'example',
'type': 'fill',
'source': "fcc-states2-4326",
'layout': ,
'paint':
'fill-color': '#088',
'fill-opacity': 0.8

);
);
</script>






layers style mapbox






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited yesterday









Vince

14.8k32749




14.8k32749










asked yesterday









user2084255user2084255

11




11












  • OK, I found some documentation and I think I'm close but the debugger shows 422 (Unknown) map.addSource("fcc-states2-4326", type: "vector", url: "api.mapbox.com/datasets/v1/mmcinnis/…..." )

    – user2084255
    7 hours ago












  • Had to add source-layer... map.addLayer( 'id': 'mmcinnis.crxr86ot', 'type': 'fill', 'source': "fcc-states2-4326", "source-layer": "fcc-states2-4326", 'layout': , 'paint': 'fill-color': '#088', 'fill-opacity': 0.8 );

    – user2084255
    7 hours ago

















  • OK, I found some documentation and I think I'm close but the debugger shows 422 (Unknown) map.addSource("fcc-states2-4326", type: "vector", url: "api.mapbox.com/datasets/v1/mmcinnis/…..." )

    – user2084255
    7 hours ago












  • Had to add source-layer... map.addLayer( 'id': 'mmcinnis.crxr86ot', 'type': 'fill', 'source': "fcc-states2-4326", "source-layer": "fcc-states2-4326", 'layout': , 'paint': 'fill-color': '#088', 'fill-opacity': 0.8 );

    – user2084255
    7 hours ago
















OK, I found some documentation and I think I'm close but the debugger shows 422 (Unknown) map.addSource("fcc-states2-4326", type: "vector", url: "api.mapbox.com/datasets/v1/mmcinnis/…..." )

– user2084255
7 hours ago






OK, I found some documentation and I think I'm close but the debugger shows 422 (Unknown) map.addSource("fcc-states2-4326", type: "vector", url: "api.mapbox.com/datasets/v1/mmcinnis/…..." )

– user2084255
7 hours ago














Had to add source-layer... map.addLayer( 'id': 'mmcinnis.crxr86ot', 'type': 'fill', 'source': "fcc-states2-4326", "source-layer": "fcc-states2-4326", 'layout': , 'paint': 'fill-color': '#088', 'fill-opacity': 0.8 );

– user2084255
7 hours ago





Had to add source-layer... map.addLayer( 'id': 'mmcinnis.crxr86ot', 'type': 'fill', 'source': "fcc-states2-4326", "source-layer": "fcc-states2-4326", 'layout': , 'paint': 'fill-color': '#088', 'fill-opacity': 0.8 );

– user2084255
7 hours ago










1 Answer
1






active

oldest

votes


















0














If you're added the data to your custom style in Mapbox Studio, ie. 'mapbox://styles/mmcinnis/cjtroguqv0t8s1fqjo9o5rwvy' then you can just skip addSource and addLayer and use your custom style as the style in the map initialisation.



Otherwise if you want to programatically add a new source and layer to your map, then addSource should be set type: "vector" if you're using a Mapbox Tileset ID, or if you want to use type: "geojson" you need to pass it either a URL to your GeoJSON file or the JSON object itself.






share|improve this answer























  • I will need the syntax for the addSource addLayer method as my next step in development is to data-join the GeoJSON with SQL query data. docs.mapbox.com/mapbox-gl-js/example/data-join

    – user2084255
    9 hours ago











  • I only see the 'id' on the mapbox tileset page, what points at the tileset? map.on('load', function () map.addSource("fcc-states2-4326", type: "vector", data: "What goes here???" ) map.addLayer( 'id': 'mmcinnis.crxr86ot', 'type': 'fill', 'source': "fcc-states2-4326", 'layout': , 'paint': 'fill-color': '#088', 'fill-opacity': 0.8 ); );

    – user2084255
    9 hours ago











  • Simply, in .addSource after type: "vector" what do you use to point to the tileset? All I see is the id? map.addSource("fcc-states2-4326", type: "vector", data: "mmcinnis.crxr86ot" )

    – user2084255
    8 hours ago











  • Where is the URL defined to the GeoJSON tileset?

    – user2084255
    8 hours ago











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "79"
;
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: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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%2fgis.stackexchange.com%2fquestions%2f316934%2fadding-geojson-tile-set-to-an-existing-map%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









0














If you're added the data to your custom style in Mapbox Studio, ie. 'mapbox://styles/mmcinnis/cjtroguqv0t8s1fqjo9o5rwvy' then you can just skip addSource and addLayer and use your custom style as the style in the map initialisation.



Otherwise if you want to programatically add a new source and layer to your map, then addSource should be set type: "vector" if you're using a Mapbox Tileset ID, or if you want to use type: "geojson" you need to pass it either a URL to your GeoJSON file or the JSON object itself.






share|improve this answer























  • I will need the syntax for the addSource addLayer method as my next step in development is to data-join the GeoJSON with SQL query data. docs.mapbox.com/mapbox-gl-js/example/data-join

    – user2084255
    9 hours ago











  • I only see the 'id' on the mapbox tileset page, what points at the tileset? map.on('load', function () map.addSource("fcc-states2-4326", type: "vector", data: "What goes here???" ) map.addLayer( 'id': 'mmcinnis.crxr86ot', 'type': 'fill', 'source': "fcc-states2-4326", 'layout': , 'paint': 'fill-color': '#088', 'fill-opacity': 0.8 ); );

    – user2084255
    9 hours ago











  • Simply, in .addSource after type: "vector" what do you use to point to the tileset? All I see is the id? map.addSource("fcc-states2-4326", type: "vector", data: "mmcinnis.crxr86ot" )

    – user2084255
    8 hours ago











  • Where is the URL defined to the GeoJSON tileset?

    – user2084255
    8 hours ago















0














If you're added the data to your custom style in Mapbox Studio, ie. 'mapbox://styles/mmcinnis/cjtroguqv0t8s1fqjo9o5rwvy' then you can just skip addSource and addLayer and use your custom style as the style in the map initialisation.



Otherwise if you want to programatically add a new source and layer to your map, then addSource should be set type: "vector" if you're using a Mapbox Tileset ID, or if you want to use type: "geojson" you need to pass it either a URL to your GeoJSON file or the JSON object itself.






share|improve this answer























  • I will need the syntax for the addSource addLayer method as my next step in development is to data-join the GeoJSON with SQL query data. docs.mapbox.com/mapbox-gl-js/example/data-join

    – user2084255
    9 hours ago











  • I only see the 'id' on the mapbox tileset page, what points at the tileset? map.on('load', function () map.addSource("fcc-states2-4326", type: "vector", data: "What goes here???" ) map.addLayer( 'id': 'mmcinnis.crxr86ot', 'type': 'fill', 'source': "fcc-states2-4326", 'layout': , 'paint': 'fill-color': '#088', 'fill-opacity': 0.8 ); );

    – user2084255
    9 hours ago











  • Simply, in .addSource after type: "vector" what do you use to point to the tileset? All I see is the id? map.addSource("fcc-states2-4326", type: "vector", data: "mmcinnis.crxr86ot" )

    – user2084255
    8 hours ago











  • Where is the URL defined to the GeoJSON tileset?

    – user2084255
    8 hours ago













0












0








0







If you're added the data to your custom style in Mapbox Studio, ie. 'mapbox://styles/mmcinnis/cjtroguqv0t8s1fqjo9o5rwvy' then you can just skip addSource and addLayer and use your custom style as the style in the map initialisation.



Otherwise if you want to programatically add a new source and layer to your map, then addSource should be set type: "vector" if you're using a Mapbox Tileset ID, or if you want to use type: "geojson" you need to pass it either a URL to your GeoJSON file or the JSON object itself.






share|improve this answer













If you're added the data to your custom style in Mapbox Studio, ie. 'mapbox://styles/mmcinnis/cjtroguqv0t8s1fqjo9o5rwvy' then you can just skip addSource and addLayer and use your custom style as the style in the map initialisation.



Otherwise if you want to programatically add a new source and layer to your map, then addSource should be set type: "vector" if you're using a Mapbox Tileset ID, or if you want to use type: "geojson" you need to pass it either a URL to your GeoJSON file or the JSON object itself.







share|improve this answer












share|improve this answer



share|improve this answer










answered 21 hours ago









AndrewHarveyAndrewHarvey

1,117510




1,117510












  • I will need the syntax for the addSource addLayer method as my next step in development is to data-join the GeoJSON with SQL query data. docs.mapbox.com/mapbox-gl-js/example/data-join

    – user2084255
    9 hours ago











  • I only see the 'id' on the mapbox tileset page, what points at the tileset? map.on('load', function () map.addSource("fcc-states2-4326", type: "vector", data: "What goes here???" ) map.addLayer( 'id': 'mmcinnis.crxr86ot', 'type': 'fill', 'source': "fcc-states2-4326", 'layout': , 'paint': 'fill-color': '#088', 'fill-opacity': 0.8 ); );

    – user2084255
    9 hours ago











  • Simply, in .addSource after type: "vector" what do you use to point to the tileset? All I see is the id? map.addSource("fcc-states2-4326", type: "vector", data: "mmcinnis.crxr86ot" )

    – user2084255
    8 hours ago











  • Where is the URL defined to the GeoJSON tileset?

    – user2084255
    8 hours ago

















  • I will need the syntax for the addSource addLayer method as my next step in development is to data-join the GeoJSON with SQL query data. docs.mapbox.com/mapbox-gl-js/example/data-join

    – user2084255
    9 hours ago











  • I only see the 'id' on the mapbox tileset page, what points at the tileset? map.on('load', function () map.addSource("fcc-states2-4326", type: "vector", data: "What goes here???" ) map.addLayer( 'id': 'mmcinnis.crxr86ot', 'type': 'fill', 'source': "fcc-states2-4326", 'layout': , 'paint': 'fill-color': '#088', 'fill-opacity': 0.8 ); );

    – user2084255
    9 hours ago











  • Simply, in .addSource after type: "vector" what do you use to point to the tileset? All I see is the id? map.addSource("fcc-states2-4326", type: "vector", data: "mmcinnis.crxr86ot" )

    – user2084255
    8 hours ago











  • Where is the URL defined to the GeoJSON tileset?

    – user2084255
    8 hours ago
















I will need the syntax for the addSource addLayer method as my next step in development is to data-join the GeoJSON with SQL query data. docs.mapbox.com/mapbox-gl-js/example/data-join

– user2084255
9 hours ago





I will need the syntax for the addSource addLayer method as my next step in development is to data-join the GeoJSON with SQL query data. docs.mapbox.com/mapbox-gl-js/example/data-join

– user2084255
9 hours ago













I only see the 'id' on the mapbox tileset page, what points at the tileset? map.on('load', function () map.addSource("fcc-states2-4326", type: "vector", data: "What goes here???" ) map.addLayer( 'id': 'mmcinnis.crxr86ot', 'type': 'fill', 'source': "fcc-states2-4326", 'layout': , 'paint': 'fill-color': '#088', 'fill-opacity': 0.8 ); );

– user2084255
9 hours ago





I only see the 'id' on the mapbox tileset page, what points at the tileset? map.on('load', function () map.addSource("fcc-states2-4326", type: "vector", data: "What goes here???" ) map.addLayer( 'id': 'mmcinnis.crxr86ot', 'type': 'fill', 'source': "fcc-states2-4326", 'layout': , 'paint': 'fill-color': '#088', 'fill-opacity': 0.8 ); );

– user2084255
9 hours ago













Simply, in .addSource after type: "vector" what do you use to point to the tileset? All I see is the id? map.addSource("fcc-states2-4326", type: "vector", data: "mmcinnis.crxr86ot" )

– user2084255
8 hours ago





Simply, in .addSource after type: "vector" what do you use to point to the tileset? All I see is the id? map.addSource("fcc-states2-4326", type: "vector", data: "mmcinnis.crxr86ot" )

– user2084255
8 hours ago













Where is the URL defined to the GeoJSON tileset?

– user2084255
8 hours ago





Where is the URL defined to the GeoJSON tileset?

– user2084255
8 hours ago

















draft saved

draft discarded
















































Thanks for contributing an answer to Geographic Information Systems Stack Exchange!


  • 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%2fgis.stackexchange.com%2fquestions%2f316934%2fadding-geojson-tile-set-to-an-existing-map%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

រឿង រ៉ូមេអូ និង ហ្ស៊ុយលីយេ សង្ខេបរឿង តួអង្គ បញ្ជីណែនាំ

QGIS export composer to PDF scale the map [closed] Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Print Composer QGIS 2.6, how to export image?QGIS 2.8.1 print composer won't export all OpenCycleMap base layer tilesSave Print/Map QGIS composer view as PNG/PDF using Python (without changing anything in visible layout)?Export QGIS Print Composer PDF with searchable text labelsQGIS Print Composer does not change from landscape to portrait orientation?How can I avoid map size and scale changes in print composer?Fuzzy PDF export in QGIS running on macSierra OSExport the legend into its 100% size using Print ComposerScale-dependent rendering in QGIS PDF output

PDF-ში გადმოწერა სანავიგაციო მენიუproject page