Home Button Question

974
3
Jump to solution
09-25-2014 07:12 AM
ChrisHolmes
Occasional Contributor III

Good day everyone,

I used the following sample to display the home button: Home Button | ArcGIS API for JavaScript

Using the following css code:

#HomeButton {

         position: absolute;

         top: 95px;

         left: 20px;

         z-index: 50;

         }

The button displays here:

HomeButton1.PNG

If I change the css to this:

#HomeButton {

         position: absolute;

         top: 175px;

         left: 260px;

         z-index: 50;

         }

The button displays here:

HomeButton2.PNG

Is there a way in the css that I can tie the home button to the map pane? Just not sure if how I am doing it is the correct way.

Thanks,

Chris

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
TimWitt2
MVP Alum

You need to put the homebutton div within the map div.

<div id="map">

<div id="HomeButton"></div>

</div>

I don't think you can tie it to the map within your CSS.

View solution in original post

3 Replies
TimWitt2
MVP Alum

You need to put the homebutton div within the map div.

<div id="map">

<div id="HomeButton"></div>

</div>

I don't think you can tie it to the map within your CSS.

ChrisHolmes
Occasional Contributor III

Thanks Tim. I had this:

<div id="map" class="shadow roundedCorners" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'center'"></div>

      <div id="HomeButton"></div>

When I should have had this:

<div id="map" class="shadow roundedCorners" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'center'">

      <div id="HomeButton"></div>

</div>

Chris

0 Kudos
TimWitt2
MVP Alum

Glad we got it figured out

0 Kudos