|
POST
|
I'm sure this is somehow possible, but most of those samples depend on a MapService published with ArcServer.
... View more
05-16-2014
04:43 AM
|
0
|
0
|
2857
|
|
POST
|
I don't think so. Depending on how many points you wan't, your code will just get big.
... View more
05-16-2014
04:30 AM
|
0
|
0
|
2857
|
|
POST
|
Joseph, If you create a new map after you saved your first one, you should find your first map in your my content folder. When you look at your map, look in the upper left corner. Hover over ArcGIS and then click "My Content". Tim
... View more
05-16-2014
04:14 AM
|
0
|
0
|
372
|
|
POST
|
Glenn, something like this? I have created map points and when you click on them or the buttons a pop-up will appear. Tim
... View more
05-16-2014
04:09 AM
|
0
|
0
|
2857
|
|
POST
|
Brandon, replace home.startup with homebutton.startup. I have adjusted the code that I posted. Tim
... View more
05-16-2014
04:04 AM
|
0
|
0
|
2102
|
|
POST
|
Ken, the issue is that his "esri/dijit/Homebutton" has a lower case "b" in Button. Here is the full code you need, plus what Ken said. <!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=7, IE=9, IE=10">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
<title>Geocoding Widget API for JavaScript | Simple Geocoding</title>
<link rel="stylesheet" href="http://js.arcgis.com/3.9/js/dojo/dijit/themes/claro/claro.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.9/js/esri/css/esri.css">
<style>
html, body, #map {
height:100%;
width:100%;
margin:0;
padding:0;
}
#search {
display: block;
position: absolute;
z-index: 2;
top: 20px;
left: 74px;
}
#HomeButton {
display: block;
position: absolute;
z-index: 2;
top: 90px;
left: 19px;
}
</style>
<script src="http://js.arcgis.com/3.9/"></script>
<script>
var map;
require([
"esri/map", "esri/dijit/Geocoder", "esri/dijit/Scalebar", "esri/dijit/HomeButton", "dojo/parser", "dojo/domReady!"
],
function(Map, Geocoder, Scalebar, HomeButton, parser) {
parser.parse();
map = new Map("map",{
basemap: "streets",
center:[-104.0,39.430], //long, lat
zoom: 13
});
var geocoder = new Geocoder({
map: map,
autoComplete: true,
arcgisGeocoder: {
name: "Esri World Geocoder",
suffix: " San Antonio, TX"
}
},"search");
geocoder.startup();
var homebutton = new HomeButton({
map: map
},
"HomeButton");
homebutton.startup();
});
</script>
</head>
<body>
<div id="search"></div>
<div id="map"><div id="HomeButton"></div></div>
</body>
</html> Hope this helps! I have also added a HomeButton style, so the button would appear below your zoom. Tim
... View more
05-15-2014
04:26 AM
|
0
|
0
|
2102
|
|
POST
|
Yes its a great tool that makes building sectors very easy! I'm glad I was able to help you!
... View more
05-15-2014
04:06 AM
|
0
|
0
|
4701
|
|
POST
|
Never mind, I figured it out. function showMap(){ dijit.registry.byId("addressView").performTransition("mapView", 1, "slide"); }
... View more
05-14-2014
11:10 AM
|
0
|
0
|
452
|
|
POST
|
Hey everybody, I was wondering if there is a command I can use within a function that will switch to the map view. This is the code I have so far: <!doctype html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <!-- On iOS, as part of optimizing your web application, have it use the standalone mode to look more like a native application. When you use this standalone mode, Safari is not used to display the web content???specifically, there is no browser URL text field at the top of the screen or button bar at the bottom of the screen. --> <meta name="apple-mobile-web-app-capable" content="yes"> <!-- Controls the dimensions and scaling of the browser window in iOS, Android, webOS, Opera Mini, Opera Mobile and Blackberry. width: controls the width of the viewport initial-scale: controls the zoom level when the page is first loaded maximum-scale: control how users are allowed to zoom the page in or out user-scalable: control how users are allowed to zoom the page in or out --> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <!-- Sets the style of the status bar for a web application when in standalone mode --> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"> <title>Getting Started - Mobile</title> <link rel="stylesheet" href="http://js.arcgis.com/3.9/js/esri/css/esri.css"> <link rel="stylesheet" href="css/main.css"> <script>var dojoConfig = { mblAlwaysHideAddressBar: true };</script> <script src="http://js.arcgis.com/3.9compact/"></script> <script> require(["esri/map", "dojox/mobile", "dojox/mobile/parser", "esri/sniff", "dojox/mobile/deviceTheme", "dojo/dom", "dijit/registry", "dojo/on", "esri/dijit/Geocoder", "esri/symbols/SimpleMarkerSymbol", "esri/symbols/SimpleLineSymbol", "esri/symbols/SimpleFillSymbol", "esri/Color", "esri/graphic", "dojo/on", "dojo/dom", "dijit/registry", "dojox/mobile/ToolBarButton", "dojox/mobile/View", "dojox/mobile/ContentPane"], function(Map, mobile, parser, has, dTheme, dom, registry, on, Geocoder, SimpleMarkerSymbol, SimpleLineSymbol, SimpleFillSymbol, Color, Graphic, on, dom, registry) { parser.parse(); mobile.hideAddressBar(); var map = new esri.Map("map", { basemap: "hybrid", center: [-80.734, 28.800], zoom: 10, slider: false }); map.on("load", mapLoadHandler); var resizeEvt = (window.onorientationchange !== undefined && !has('android')) ? "orientationchange" : "resize"; on(window, resizeEvt, resizeMap); function mapLoadHandler(evt) { resizeMap(); registry.byId('mapView').on('AfterTransitionIn', resizeMap); } function resizeMap() { mobile.hideAddressBar(); adjustMapHeight(); map.resize(); map.reposition(); } function adjustMapHeight() { var availHeight = mobile.getScreenSize().h - registry.byId('header').domNode.clientHeight - 1; if (has('iphone') || has('ipod')) { availHeight += iphoneAdjustment(); } dom.byId("map").style.height = availHeight + "px"; } function iphoneAdjustment() { var sz = mobile.getScreenSize(); if (sz.h > sz.w) { //portrait //Need to add address bar height back to map return screen.availHeight - window.innerHeight - 40; /* 40 = height of bottom safari toolbar */ } else { //landscape //Need to react to full screen / bottom bar visible toggles var _conn = on(window, 'resize', function() { _conn.remove(); resizeMap(); }); return 0; } } geocoder = new Geocoder ({ arcgisGeocoder: false, geocoders: [ { url: "http://gis.brevardcounty.us/gissrv/rest/services/Geocode/Address_Locator_WKID2881/GeocodeServer", name: "Brevard County", placeholder: "Find a place", outfields: "*" }], map:map }, "geocodeDiv"); geocoder.startup(); geocoder.on("select", showLocation); geocoder.on("find-results", showMap); map.infoWindow.on("hide", doclear2); function showLocation(evt) { map.graphics.clear(); var point = evt.result.feature.geometry; var symbol = new SimpleMarkerSymbol() .setStyle("square") .setColor(new Color([255,0,0,0.5])); var graphic = new Graphic(point, symbol); map.graphics.add(graphic); map.infoWindow.setTitle("Search Result"); map.infoWindow.setContent(evt.result.name); map.infoWindow.show(evt.result.feature.geometry); map.infoWindow.resize(180, 100); }; function showMap(){ moveTo:'mapView'; } function doclear2(){ map.graphics.clear(); map.infoWindow.hide(); } }); </script> </head> <body> <div id="mapView" data-dojo-type="dojox.mobile.View" data-dojo-props="selected: true"> <div id="header" data-dojo-type="dojox.mobile.Heading"> <div id="aboutButton" data-dojo-type="dojox.mobile.ToolBarButton" style="float: right;" moveTo="aboutView">About</div> <div id="addressButton" data-dojo-type="dojox.mobile.ToolBarButton" style="float: left;" moveTo="addressView">Search</div> </div> <div id="mapContainer" data-dojo-type="dojox.mobile.ContentPane"> <div id="map"></div> </div> </div> <div id="aboutView" data-dojo-type="dojox.mobile.View"> <h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props="back:'Map', moveTo:'mapView'">About</h1> <p style="padding: 5px;">This area can contain address information about your application.</p> </div> <div id="addressView" data-dojo-type="dojox.mobile.View"> <h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props="back:'Map', moveTo:'mapView'">Address</h1> <p style="padding: 5px;">Type in an Address</p> <div id="geocodeDiv"></div> </div> </body> </html> I want the showMap function to bring me back to the map view. Any help is appreciated! Thanks, Tim
... View more
05-14-2014
10:28 AM
|
0
|
1
|
892
|
|
POST
|
Oh I see, is this what you are trying to do, with the addition of, once a user clicks on the grid you would like to zoom to it and the popup to appear?
... View more
05-14-2014
05:38 AM
|
0
|
0
|
1522
|
|
POST
|
Ryan, This might be helpful? Instead of my button you would use your search button. Tim
... View more
05-14-2014
04:29 AM
|
0
|
0
|
1522
|
|
POST
|
Laura, Maybe try to incorporate this type of infowindow. With this you will be able to flip through all the points that have been selected. Tim
... View more
05-13-2014
04:28 AM
|
0
|
0
|
1202
|
|
POST
|
Hey everybody, Is there a way to turn of the infoTemplate property of a FeatureLayer via a button? var cities = new FeatureLayer( "http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/0", { mode: FeatureLayer.MODE_ONDEMAND, infoTemplate:templateCity, outFields: ["*"] }); On start when I click on the city layer I want the popup to work, but when I push a button the popup won't work. How can I manipulate the infoTemplate property? Thanks, Tim
... View more
04-30-2014
06:08 AM
|
0
|
2
|
1110
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-25-2013 07:58 AM | |
| 1 | 03-06-2014 06:03 AM | |
| 4 | 12-09-2013 03:25 AM | |
| 1 | 04-16-2014 04:11 AM | |
| 1 | 04-24-2014 10:53 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|