|
POST
|
There’s a new way to easily search your mapping data. The ArcGIS JavaScript API’s new Search dijit precedes the Geocoder dijit (now deprecated). It’s been re-imagined, renamed and redesigned to provide a single searching and suggestion experience. It allows you to search across multiple Locator and Feature Layer services from a simple interface. Whereas the Geocoder dijit’s intention was for searching only Locator tasks, the Search dijit was designed to handle multiple types of “sources,” including Locator tasks, Feature Layers and potentially more. The user interface has also been improved to handle searching one more of these sources. With the Search dijit, you can search or get suggestions from all the defined sources or a single source. Much of the same functionality found in the Geocoder widget is also present in the Search dijit, but many new features have been added and redesigned for a better user and developer experience. As a developer, it should be easier for you to configure the Search widget and less code to write in order to handle common searching tasks. The icons for the widget use a font, so properties like the color or size can easily be modified. New Features include: Ability to search and get suggestions from Feature Layers Automatically add Feature Layers from a map to the widget Display additional search results to a user in the popup as “more results” Highlight a result with a symbol Label a result with a text symbol. Results for suggestions and searches are separated and have different events Optional button-mode to expand or collapse the search interface from a single button Easily set an InfoTemplate to display custom popup information for a result Individual placeholders for each search source... and more Have fun exploring the demos or implementing it in your app.
... View more
03-06-2015
05:59 PM
|
4
|
65
|
32987
|
|
POST
|
no problem! I am told one workaround is this: If the locator is recreated with GCS WGS 84 and republished, it will work.
... View more
01-05-2015
02:33 PM
|
0
|
0
|
556
|
|
POST
|
Hi Jay, I am told that the extent not returning correctly is a bug that is fixed in 10.3.1. There is a patch planned.
... View more
01-05-2015
01:33 PM
|
0
|
2
|
556
|
|
POST
|
Yes, that makes sense. It seems it's because the extent is not defined correctly. I'm not sure if its because something in the locator needs to be configured or an extent needs to be created for each result. If the extent isn't returned, then it would use the location point.
... View more
01-05-2015
01:19 PM
|
0
|
0
|
556
|
|
POST
|
Is the JSON above from the geocoder widget? If so, can you send the actual network response from the network tab of the debugger tools? It would be interesting to see what the network is returning during a search. It may not be returning geometry or something it needs and that's why the extent is being set to NaN. Is there anyway you can share the service URL so I could take a look?
... View more
01-05-2015
10:33 AM
|
0
|
5
|
1809
|
|
POST
|
It looks like it's because the extent has values that are NaN. Is there a way you can either remove the extent or set the values?
... View more
01-05-2015
10:00 AM
|
0
|
7
|
1809
|
|
POST
|
Hey Jay, Could you post the network response JSON from when a find occurs? It seems like the response may be missing something. Thanks
... View more
01-05-2015
08:53 AM
|
0
|
9
|
1809
|
|
POST
|
Hi Jay, This is a bug, thanks for letting us know. The fix is already on the Github code if you need it now. It will be in the next release.
... View more
01-02-2015
10:44 AM
|
3
|
0
|
999
|
|
POST
|
Hi Jay, Could you try setting suggest:true on your locator? That should get the autocomplete working. var myGeocoders = [{
url: locatorUrl,
name: "AirportsGeocode",
suggest: true,
singleLineFieldName: "SingleKey"
}];
... View more
01-02-2015
10:40 AM
|
0
|
11
|
1809
|
|
POST
|
The locator task has a suggestLocations method which uses the locator suggest. locator-amd | API Reference | ArcGIS API for JavaScript
... View more
12-03-2014
03:37 PM
|
0
|
1
|
893
|
|
POST
|
Hello, It's because the default basemap is topo and it doesnt know what topo is. This will be easier in 3.12 to set custom basemaps and use them with the BasemapToggle widget. This should work: <!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<title>Basemap Toggle</title>
<link rel="stylesheet" type="text/css" href="http://js.arcgis.com/3.11/esri/css/esri.css">
<style>
html,
body,
#map {
padding: 0;
margin: 0;
height: 100%;
}
#BasemapToggle {
position: absolute;
top: 20px;
right: 20px;
z-index: 50;
}
</style>
<script src="//js.arcgis.com/3.11/"></script>
<script>
var map;
require([
"esri/map",
"esri/dijit/BasemapToggle",
"esri/config",
"dojo/domReady!"
], function (
Map, BasemapToggle, esriConfig
) {
esriConfig.defaults.map.basemaps.BaseMapEnglish = {
baseMapLayers: [
{
url: "http://geoportal.abudhabi.ae/rest/services/BaseMapEnglish/MapServer"
}
],
title: "BaseMapEnglish"
};
esriConfig.defaults.map.basemaps.BaseMapSatellite = {
baseMapLayers: [
{
url: "http://geoportal.abudhabi.ae/rest/services/BaseMapSatellite1m/MapServer"
}
],
title: "BaseMapSatellite"
};
map = new Map("map", {
center: [-70.6508, 43.1452],
zoom: 16,
basemap: "BaseMapEnglish"
});
var toggle = new BasemapToggle({
map: map,
basemap: "BaseMapSatellite",
defaultBasemap: "BaseMapEnglish",
basemaps: {
BaseMapEnglish: {
label: "BaseMapEnglish",
url: "http://www.delorme.com/images/homepage/dbm_icon.jpg"
},
BaseMapSatellite: {
label: "BaseMapSatellite",
url: "http://js.arcgis.com/3.7/js/esri/dijit/images/basemaps/topo.jpg"
}
}
}, "BasemapToggle");
toggle.startup();
var MDServiceLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://10.10.1.108:6080/arcgis/rest/services/ZS_MapDoc/MapServer", {
"id": 'ZS',
"opacity": 0.6
});
var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://geoportal.abudhabi.ae/rest/services/BaseMapSatellite50cm/MapServer");
map.addLayer(basemap);
map.addLayer(MDServiceLayer);
});
</script>
</head>
<body>
<div id="map" class="map">
<div id="BasemapToggle"></div>
</div>
</body>
</html>
... View more
12-02-2014
08:11 AM
|
1
|
0
|
1162
|
|
POST
|
Here's what I would do: 1. Create a class on the body of the HTML and call it something like "loading". 2. Put all the stuff you want hidden at runtime in a div and give it a class like "app-content". 3. In CSS, write something like this:
.app-content{
display:block;
}
.loading .app-content{
display:none;
}
4. Once the page is ready, remove the loading class from the body of the html. 5. Eat cake If you want a loading spinner you could have another div displayed via css like this:
.loading-spinner{
display:none;
}
.loading .loading-spinner{
display:block;
position:absolute;
z-index:2;
left:0;
top:0;
width:100%;
height:100%;
background: url(myspinner.gif) center center no-repeat;
}
... View more
11-20-2014
01:39 PM
|
0
|
0
|
693
|
|
POST
|
That won't work. the location will always be returned in 4326 coordinates. So in showLocation() you just need to convert that point into your map's spatial reference with esri.config.geometryService.project(); Project a point | ArcGIS API for JavaScript geometryservice-amd | API Reference | ArcGIS API for JavaScript
function showLocation(location) {
//zoom to the users location and add a graphic
var pt = new Point(location.coords.longitude, location.coords.latitude); // this is 4326
// project this point here
// then after it's projected, add it to map
if (!graphic) {
addGraphic(pt);
} else { // move the graphic if it already exists
graphic.setGeometry(pt);
}
map.centerAt(pt);
}
... View more
11-18-2014
03:22 PM
|
2
|
4
|
1223
|
|
POST
|
You need to project the graphic into your maps spatial reference. That should fix everything. geometryservice-amd | API Reference | ArcGIS API for JavaScript You could just use the LocateButton to handle all of this code for you. locatebutton-amd | API Reference | ArcGIS API for JavaScript
... View more
11-18-2014
11:08 AM
|
0
|
6
|
1929
|
|
POST
|
Hey Jerry, It's on the list of enhancements to implement but may be a while.
... View more
10-31-2014
09:38 AM
|
1
|
0
|
1301
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-14-2024 01:33 PM | |
| 1 | 12-01-2023 11:14 AM | |
| 1 | 06-23-2021 09:54 AM | |
| 1 | 04-12-2018 11:10 AM | |
| 1 | 04-09-2015 03:08 PM |
| Online Status |
Offline
|
| Date Last Visited |
a week ago
|