Select to view content in your preferred language

Stupid zoom question

2662
21
Jump to solution
04-23-2014 07:20 AM
jaykapalczynski
Honored Contributor
Looking at this example...I can see the locate button widget.

I am not seeing where the Zoom in and Zoom out buttons are being defined !

https://developers.arcgis.com/javascript/jssamples/widget_locate.html
0 Kudos
21 Replies
jaykapalczynski
Honored Contributor
trying to get this to work....topo wont even display

Trying to get a home button, Location Button, and the Zoom in and zoom out

http://jsfiddle.net/Jaykapalczynski/WyMzY/11/
0 Kudos
JakeSkinner
Esri Esteemed Contributor
Looks like you forgot to call the "dojo/parser" module. 

http://jsfiddle.net/WyMzY/12/
0 Kudos
LuciHawkins
Frequent Contributor
You need to reference the esri stylesheet and javascript api

<link rel="stylesheet" type="text/css" href="http://js.arcgis.com/3.9/js/esri/css/esri.css">
<script src="//js.arcgis.com/3.9/"></script>

Also, you will not get the zoom in/out buttons with slider: false needs to be slider: true

app.map = new esri.Map("map", { 
basemap: "topo", 
center: [-77.4329, 37.5410], 
zoom: 7, 
   slider: false,  
showAttribution:false, 
logo: false 
}); 


Hope this helps,

Luci
0 Kudos
jaykapalczynski
Honored Contributor
So weird I have no idea whats going on...I clear my cache and refreshed my Website...

The parser was added here but still no Zoom in and ZOom out

http://jsfiddle.net/Jaykapalczynski/WyMzY/15/

Below is a snip of my code that should be making this happen, but no go...the Hoem and Locate button are there but no Zoom in Zoom out

     
        <div id="MapContainer" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top'">
      <div id="map" class="map">
       <div id="HomeButton"></div>
       <div id="LocateButton"></div>
         </div>
     </div>


 
    <link rel="stylesheet" href="https://js.arcgis.com/3.9/js/esri/css/esri.css">
    <script src="https://js.arcgis.com/3.9/"></script>

    app.map = new esri.Map("map", {
       basemap: "topo",
       center: [-77.4329, 37.5410],
       zoom: 7,
       slider: false,
       showAttribution:true,
       logo: false
    });

      var home = new HomeButton({
        map: app.map
      }, "HomeButton");
      home.startup();

      var geoLocate = new LocateButton({
        map: app.map
      }, "LocateButton");
      geoLocate.startup();
0 Kudos
LuciHawkins
Frequent Contributor
Change your code:

<link rel="stylesheet" href="https://js.arcgis.com/3.9/js/esri/css/esri.css"> 
<script src="https://js.arcgis.com/3.9/"></script> 

app.map = new esri.Map("map", { 
basemap: "topo", 
center: [-77.4329, 37.5410], 
zoom: 7, 
slider: false,   //this should be slider: true,  
showAttribution:true, 
logo: false 
}); 

var home = new HomeButton({ 
map: app.map 
}, "HomeButton"); 
home.startup(); 

var geoLocate = new LocateButton({ 
map: app.map 
}, "LocateButton"); 
geoLocate.startup();


If you change slider: false, to slider: true, you will see the + - zoom buttons

Luci
0 Kudos
jaykapalczynski
Honored Contributor
alright its working in the JSFiddle  but for some reason not in my code....this is so simple dont know why I am having an issue.
Will try again...
0 Kudos
jaykapalczynski
Honored Contributor
Alright this is VERY weird....I got the example aobve working fine in JS Fiddle.

I pasted all my code from my project into JS Fiddle and it worked.  The exact same code in my project does not display the zoom buttons....wow

The only thing thats different between my project is that JSFiddle requires the below

  • where i define the stylesheets

  • removal of the meta data

  • removal of the <html><head> tags

  • removal of my defined .js page and .css page....of which were copied verbatum into the JS Fiddle.




  • I cleared my cache many times

  • I refreshed the web service many times. 

  • Check in 3 different browsers (IE, Chrome, Firefox)

  • No blatant errors in the Chromes debugging Console window



This is driving me nuts....what the heck can be different or causing this
0 Kudos
JakeSkinner
Esri Esteemed Contributor
If you'd like, post your code as you have it in your project.  Be sure to wrap it in CODE tags.
0 Kudos
jaykapalczynski
Honored Contributor
THINKING I MIGHT HAVE GOTTEN IT...I REMOVED A TON OF MY CODE AND STARTED FROM SCRATCH

I am going to add each piece back untill i error out....BRB
0 Kudos
jaykapalczynski
Honored Contributor
THINK I MIGHT HAVE GOTTEN IT......BRB
0 Kudos