Default view settings

  • 1
  • Question
  • Updated 5 years ago
Hi - I like the GeoCommons interface, and I'd like to use it for a content provider, but I have a question about default settings. The content provider would like the default view to be of a certain geographic area, and allow users to zoom out from there. Is this possible? Also, we would like the map to open up with the layers tab minimized. This is also possible out of the box, or does it require use of the API. Thanks!
Photo of

  • 1 Post
  • 0 Reply Likes
  • frustrated

Posted 5 years ago

  • 1
Photo of Emily

Emily, Official Rep

  • 873 Posts
  • 19 Reply Likes

Here is some info from one of our developers, hope it helps...

"most of this can be done via the API.

The map will zoom into the same extent it has when it's saved, so you
can have a default location.
They can also use the setExtent method if they want to do it on the fly.

At the moment for geocommons there's no API call for turning off the
layers pallette - there will be in the new version coming out within
the month.

In meantime they can do jq(".layer_panel").hide()
Photo of gomres


  • 2 Posts
  • 0 Reply Likes
I woulk like this to (hide the layers tool) +1
about the "jq(".layer_panel").hide()" wher can I use this, schould I have an API??

Thanks you are doing a great job
Photo of Emily

Emily, Official Rep

  • 873 Posts
  • 19 Reply Likes
Hi Tarek,

Thanks. I will get an answer for you on this.

Photo of tim.waters

tim.waters, Employee

  • 6 Posts
  • 1 Reply Like
Hi Tarek,

Yes, you would use this in the javascript within the embed code:

<style>#geocommons_map_150690 {width: 100%; height: 400px; position:relative;}</style>
<div class="geocommons_map" id="geocommons_map_150690"></div><br/>
<a class="geocommons_map_link" id="geocommons_map_150690_link" href="">View map on GeoCommons</a>
<script type="text/javascript" charset="utf-8" src=""></script>
<script type="text/javascript" charset="utf-8">
var geocommons_map_150690 = new F1.Maker.Map({map_id: "150690", dom_id: "geocommons_map_150690", onMapReady: function(){



So the additional bit here is that the layer panel gets hidden when the onMapReady event is fired.