Skip to main content
deleted 82 characters in body; edited tags; edited tags
Source Link
PolyGeo
  • 65.5k
  • 29
  • 115
  • 353

I am using geojson-dashboard framework template for Leaflet (http://fulcrumapp.github.io/geojson-dashboard/).

enter image description here

By default, the initial view of the screen is "splitted" or "divided" (half view is the map and the other half is a geojson table). What I'm trying to do is to modify the function in order to set the initial view of the screen only with the map.

The function that acts on that is the following:

function switchView(view) { if (view == "split") { $("#view").html("Split View"); location.hash = "#split"; $("#table-container").show(); $("#table-container").css("height", "55%"); $("#map-container").show(); $("#map-container").css("height", "45%"); $(window).resize(); if (map) { map.invalidateSize(); } } else if (view == "map") { $("#view").html("Map View"); location.hash = "#map"; $("#map-container").show(); $("#map-container").css("height", "100%"); $("#table-container").hide(); if (map) { map.invalidateSize(); } } else if (view == "table") { $("#view").html("Table View"); location.hash = "#table"; $("#table-container").show(); $("#table-container").css("height", "100%"); $("#map-container").hide(); $(window).resize(); } } $("[name='view']").click(function() { $(".in,.open").removeClass("in open"); if (this.id === "map-graph") { switchView("split"); return false; } else if (this.id === "map-only") { switchView("map"); return false; } else if (this.id === "graph-only") { switchView("table"); return false; } }); 

I've tried in a thousand ways but I don't know how to solve in order to establish "Map View" as the initial view.

If someone can help me out, it would be very helpful. Thanks a lot in advance.

I am using geojson-dashboard framework template for Leaflet (http://fulcrumapp.github.io/geojson-dashboard/).

enter image description here

By default, the initial view of the screen is "splitted" or "divided" (half view is the map and the other half is a geojson table). What I'm trying to do is to modify the function in order to set the initial view of the screen only with the map.

The function that acts on that is the following:

function switchView(view) { if (view == "split") { $("#view").html("Split View"); location.hash = "#split"; $("#table-container").show(); $("#table-container").css("height", "55%"); $("#map-container").show(); $("#map-container").css("height", "45%"); $(window).resize(); if (map) { map.invalidateSize(); } } else if (view == "map") { $("#view").html("Map View"); location.hash = "#map"; $("#map-container").show(); $("#map-container").css("height", "100%"); $("#table-container").hide(); if (map) { map.invalidateSize(); } } else if (view == "table") { $("#view").html("Table View"); location.hash = "#table"; $("#table-container").show(); $("#table-container").css("height", "100%"); $("#map-container").hide(); $(window).resize(); } } $("[name='view']").click(function() { $(".in,.open").removeClass("in open"); if (this.id === "map-graph") { switchView("split"); return false; } else if (this.id === "map-only") { switchView("map"); return false; } else if (this.id === "graph-only") { switchView("table"); return false; } }); 

I've tried in a thousand ways but I don't know how to solve in order to establish "Map View" as the initial view.

If someone can help me out, it would be very helpful. Thanks a lot in advance.

I am using geojson-dashboard framework template for Leaflet (http://fulcrumapp.github.io/geojson-dashboard/).

enter image description here

By default, the initial view of the screen is "splitted" or "divided" (half view is the map and the other half is a geojson table). What I'm trying to do is to modify the function in order to set the initial view of the screen only with the map.

The function that acts on that is the following:

function switchView(view) { if (view == "split") { $("#view").html("Split View"); location.hash = "#split"; $("#table-container").show(); $("#table-container").css("height", "55%"); $("#map-container").show(); $("#map-container").css("height", "45%"); $(window).resize(); if (map) { map.invalidateSize(); } } else if (view == "map") { $("#view").html("Map View"); location.hash = "#map"; $("#map-container").show(); $("#map-container").css("height", "100%"); $("#table-container").hide(); if (map) { map.invalidateSize(); } } else if (view == "table") { $("#view").html("Table View"); location.hash = "#table"; $("#table-container").show(); $("#table-container").css("height", "100%"); $("#map-container").hide(); $(window).resize(); } } $("[name='view']").click(function() { $(".in,.open").removeClass("in open"); if (this.id === "map-graph") { switchView("split"); return false; } else if (this.id === "map-only") { switchView("map"); return false; } else if (this.id === "graph-only") { switchView("table"); return false; } }); 

I've tried in a thousand ways but I don't know how to solve in order to establish "Map View" as the initial view.

Source Link
abrobia
  • 167
  • 1
  • 1
  • 8

Setting "Map View" instead of "Split View" in Leaflet javascript

I am using geojson-dashboard framework template for Leaflet (http://fulcrumapp.github.io/geojson-dashboard/).

enter image description here

By default, the initial view of the screen is "splitted" or "divided" (half view is the map and the other half is a geojson table). What I'm trying to do is to modify the function in order to set the initial view of the screen only with the map.

The function that acts on that is the following:

function switchView(view) { if (view == "split") { $("#view").html("Split View"); location.hash = "#split"; $("#table-container").show(); $("#table-container").css("height", "55%"); $("#map-container").show(); $("#map-container").css("height", "45%"); $(window).resize(); if (map) { map.invalidateSize(); } } else if (view == "map") { $("#view").html("Map View"); location.hash = "#map"; $("#map-container").show(); $("#map-container").css("height", "100%"); $("#table-container").hide(); if (map) { map.invalidateSize(); } } else if (view == "table") { $("#view").html("Table View"); location.hash = "#table"; $("#table-container").show(); $("#table-container").css("height", "100%"); $("#map-container").hide(); $(window).resize(); } } $("[name='view']").click(function() { $(".in,.open").removeClass("in open"); if (this.id === "map-graph") { switchView("split"); return false; } else if (this.id === "map-only") { switchView("map"); return false; } else if (this.id === "graph-only") { switchView("table"); return false; } }); 

I've tried in a thousand ways but I don't know how to solve in order to establish "Map View" as the initial view.

If someone can help me out, it would be very helpful. Thanks a lot in advance.