POST
|
I found the answers.. Need to add the script tag for esri javascript after the script tag for the jquery-ui...and then it works
... View more
10-18-2015
09:43 PM
|
0
|
0
|
383
|
POST
|
I tried to work with geosearch-template from Esri/bootstrap-map-js · GitHub However I wanted to add <script src="//code.jquery.com/ui/1.11.1/jquery-ui.min.js"></script> after the jquery script reference and I get the error like this(shows in firebug in firefox). Error: multipleDefine d()/3.14compact/ (line 5) Ja()/3.14compact/ (line 27) Xa/<()/3.14compact/ (line 28) a()/3.14compact/ (line 5) Xa()/3.14compact/ (line 28) pa/g()/3.14compact/ (line 25) r.injectUrl/f<() The reason I wanted to add the jquery-ui reference, so that I can use some function from jquery-ui (like dialog())..... Here is my complete page code: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <meta name="description" content=""> <meta name="author" content=""> <link rel="shortcut icon" href="../images/favicon.png"> <title>Geosearch Template for Bootstrap</title> <!-- Bootstrap core CSS --> <link href="https://community.esri.com//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet"> <!-- Custom styles for this template --> <link href="geosearch-template.css" rel="stylesheet"> <!-- Bootstrap-map-js --> <link rel="stylesheet" type="text/css" href="https://community.esri.com//js.arcgis.com/3.13/esri/css/esri.css"> <link rel="stylesheet" type="text/css" href="../../src/css/bootstrapmap.css"> <style type="text/css"> #mapDiv { min-height: 100%; max-height: 100%; } .simpleGeocoder { margin-right: 5px; } /* Option 2: Geosearch in nav; .simpleGeocoder .esriGeocoderContainer { width: 180px; } .simpleGeocoder .esriGeocoder input { width: 118px; } @media (max-width: 767px) { .navbar-form .form-group { float: left; } .simpleGeocoder { margin-right: 7px; } } */ </style> <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="../bootstrap_v3/docs-assets/js/html5shiv.js"></script> <script src="../bootstrap_v3/docs-assets/js/respond.min.js"></script> <![endif]--> </head> <body> <div class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#">Geosearch</a> </div> <div class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li class="active"><a href="#">Home</a></li> <li><a href="#about">About</a></li> <li><a href="#contact">Contact</a></li> </ul> <!--Option 1: Modal--> <ul class="nav navbar-nav"> <li><a id="geosearchNav" href="#">Geosearch</a></li> </ul> <!--Option 2: Insert in nav bar--> <!-- <form class="navbar-form navbar-right"> <div class="form-group"> <div id="geosearch"></div> </div> <button id="btnGeosearch" type="submit" class="btn btn-success">Search</button> </form> --> </div><!--/.nav-collapse --> </div> </div> <div id="modaldialog">Hery I am here</div> <div class="modal fade" id="geosearchModal" style="display: none;" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title">Geosearch</h4> </div> <div class="modal-body"> <form id="geosearch-form"> <div class="form-group"> <div id="geosearch"></div> </div> <button id="btnGeosearch" type="button" class="btn btn-success" data-dismiss="modal"> Go </button> <button id="btnClear" type="submit" class="btn btn-default" data-dismiss="modal">Clear</button> </form> </div> </div><!-- /.modal-content --> </div><!-- /.modal-dialog --> </div> <!-- Bootstrap-map-js --> <div id="mapDiv"></div> <script type="text/javascript"> var package_path = window.location.pathname.substring(0, window.location.pathname.lastIndexOf('/')); var dojoConfig = { //The location.pathname.replace() logic below may look confusing but all its doing is // enabling us to load the api from a CDN and load local modules from the correct location. packages: [{ name: "application", location: package_path + '../../../src/js' }] }; </script> <script src="//js.arcgis.com/3.14compact/"></script> <!--<script src="//js.arcgis.com/3.13compact"></script>--> <script> require(["esri/map", "esri/dijit/Scalebar", "esri/dijit/Geocoder", "esri/InfoTemplate", "esri/graphic", "esri/geometry/Multipoint", "esri/symbols/PictureMarkerSymbol", "esri/dijit/Popup", "dojo/dom", "dojo/on", "application/bootstrapmap", "dojo/domReady!"], function (Map, Scalebar, Geocoder, InfoTemplate, Graphic, Multipoint, PictureMarkerSymbol, Popup, dom, on, BootstrapMap) { "use strict"; // Get a reference to the ArcGIS Map class var map = BootstrapMap.create("mapDiv", { basemap: "streets", center:[-122.45, 37.77], zoom: 12, scrollWheelZoom: false }); var scalebar = new Scalebar({ map: map, scalebarUnit: "dual" }); // Create widget var geocoder = new Geocoder({ value: 'starbucks', maxLocations: 10, autoComplete: true, arcgisGeocoder: true, map: map },"geosearch"); geocoder.startup(); geocoder.on("select", geocodeSelect); geocoder.on("findResults", geocodeResults); geocoder.on("clear", clearFindGraphics); // Geosearch functions on(dom.byId("btnGeosearch"),"click", geosearch); on(dom.byId("btnClear"),"click", clearFindGraphics); map.on("load", function () { map.infoWindow.offsetY = 25; map.infoWindow.set("highlight", false); }); function geosearch() { var def = geocoder.find(); def.then(function(res){ geocodeResults(res); }); } function geocodeSelect(item) { var g = (item.graphic ? item.graphic : item.result.feature); g.setSymbol(sym); addPlaceGraphic(item.result,g.symbol); } function geocodeResults(places) { places = places.results; if (places.length > 0) { clearFindGraphics(); var symbol = sym; // Create and add graphics with pop-ups for (var i = 0; i < places.length; i++) { addPlaceGraphic(places, symbol); } zoomToPlaces(places); } else { alert("Sorry, address or place not found."); } } function addPlaceGraphic(item,symbol) { var place = {}; var attributes,infoTemplate,pt,graphic; pt = item.feature.geometry; place.address = item.name; place.score = item.feature.attributes.Score; // Graphic components attributes = { address:place.address, score:place.score, lat:pt.getLatitude().toFixed(2), lon:pt.getLongitude().toFixed(2) }; infoTemplate = new InfoTemplate("${address}","Latitude: ${lat}<br/>Longitude: ${lon}<br/>Score: ${score}"); graphic = new Graphic(pt,symbol,attributes,infoTemplate); // Add to map map.graphics.add(graphic); } function zoomToPlaces(places) { var multiPoint = new Multipoint(map.spatialReference); for (var i = 0; i < places.length; i++) { //multiPoint.addPoint(places.location); multiPoint.addPoint(places.feature.geometry); } map.setExtent(multiPoint.getExtent().expand(2.0)); } function clearFindGraphics() { map.infoWindow.hide(); map.graphics.clear(); } function createPictureSymbol(url, xOffset, yOffset, xWidth, yHeight) { return new PictureMarkerSymbol( { "angle": 0, "xoffset": xOffset, "yoffset": yOffset, "type": "esriPMS", "url": url, "contentType": "image/png", "width":xWidth, "height": yHeight }); } var sym = createPictureSymbol("../images/blue-pin.png", 0, 12, 13, 24); // Show modal dialog, hide nav $(document).ready(function(){ // Close menu $('.nav a').on('click', function(){ $(".navbar-toggle").click(); }); // Geosearch nav menu is selected $("#geosearchNav").click(function(e){ $("#geosearchModal").modal("show"); // // Bootstrap work-around $("body").css("margin-right","0px"); $(".navbar").css("margin-right","0px"); }); }); }); </script> <!-- Bootstrap core JavaScript ================================================== --> <!-- Placed at the end of the document so the pages load faster --> <script src="http://code.jquery.com/jquery-1.11.1.min.js"></script> <script src="//code.jquery.com/ui/1.11.1/jquery-ui.min.js"></script> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script> </body> </html>
... View more
10-18-2015
07:34 PM
|
0
|
1
|
2807
|
POST
|
HI I tried to use jsPanel 2.5.5 with javascript api 3.14, but it did not work.. Did any body try this? or any other floating panel that goes with javascript api 3.14
... View more
10-15-2015
01:23 PM
|
0
|
1
|
2229
|
POST
|
HI: Any idea about what time geoprocessing will be included (beta2 or release and approx. dates).. We are working on a project that needs geoprocessing… Another issue, can earlier api (3.4) can be used in addition to api 4 (can both be used same time in the same page) to get some functionalities from both api…? Thanks. Abu Khan Senior Computer Applications Analyst Division of Information Technology 202-974-7036
... View more
10-05-2015
11:53 AM
|
0
|
1
|
569
|
POST
|
Hi I appreciate. Did you have chance to look for the geoprocessor service request call that will return a geometry ? Thanks. Abu Khan Senior Computer Applications Analyst Division of Information Technology 202-974-7036
... View more
10-05-2015
10:45 AM
|
0
|
3
|
569
|
POST
|
I need to see an example for adding a tile layer from our own server (cached rest service) using beta4 Also need to see an example to run a geoprocessing service and return a geometry using beta4 all examples for 2D only
... View more
10-05-2015
08:50 AM
|
0
|
8
|
2820
|
POST
|
THanks for all these.. ---Can the Geocoder tag have a search icon at the end of the inputbox where user can click (rather than just press enter)? -- for own geocoder, i tried with the url property of the geocoder,, but it did not work ..... --- in your identify function code: the graphic is getting the map center, how it is getting the address point x,y? private function identifyMap():void { //Zoom to the location, clear the graphics layer and add a new graphic to the map map.scale = 2000; selectedGraphic.clear(); var mapPointIcon:PictureMarkerSymbol = new PictureMarkerSymbol(); mapPointIcon.source = "assets/trash.png"; var selGraphic:Graphic= new Graphic(new MapPoint(map.center.x, map.center.y, map.spatialReference), mapPointIcon); selectedGraphic.add(selGraphic); THnaks. abu
... View more
04-07-2014
10:21 AM
|
0
|
0
|
545
|
POST
|
Also i need to show what match address was found.... and the score
... View more
04-03-2014
11:55 AM
|
0
|
0
|
545
|
POST
|
need to use our own locator (can not use world geo locator)? Can it be done? Thanks
... View more
04-03-2014
11:24 AM
|
0
|
0
|
545
|
POST
|
Hi : I am trying to do geocoding using flex api... Here is the issue. After typing the address, press the find button. What I need: It should show point on the map.. and also use this point, query a layer (say county/tract) to get the results(like county code, tract code) from this layer without any click on the map I tried to use the identify feature shown in the example, but the results.length becomes zero. and did not show any results. here is the find address: private function doFind():void { var parameters:AddressToLocationsParameters = new AddressToLocationsParameters(); myGraphicsLayer.clear(); parameters.address = { SingleLine: onelineaddress.text }; // Use outFields to get back extra information // The exact fields available depends on the specific Locator used. parameters.outFields = [ "Loc_name" ]; locator.addressToLocations(parameters, new AsyncResponder(onResult, onFault)); function onResult(candidates:Array, token:Object = null):void { if (candidates.length > 0) { var addressCandidate:AddressCandidate = candidates[0]; var myGraphic:Graphic = new Graphic(); var myGraphicWGS:Graphic = new Graphic(); // for 9.3 servers, or anything else returning latlong: myGraphic.geometry = WebMercatorUtil.geographicToWebMercator(addressCandidate.location); myGraphic.geometry = addressCandidate.location; myGraphic.symbol = mySymbol; myGraphic.toolTip = addressCandidate.address.toString(); myGraphic.id = "graphic"; myGraphicsLayer.add(myGraphic); MainMap.centerAt(myGraphic.geometry as MapPoint); // Zoom to an appropriate level // Note: your attribute and field value might differ depending on which Locator you are using... if (addressCandidate.attributes.Loc_name.search("RoofTop") > 0) // US_RoofTop { MainMap.scale = 10000; } else if (addressCandidate.attributes.Loc_name.search("Address") > 0) { MainMap.scale = 10000; } else if (addressCandidate.attributes.Loc_name.search("Street") > 0) // US_Streets, CAN_Streets, CAN_StreetName, EU_Street_Addr* or EU_Street_Name* { MainMap.scale = 15000; } else if (addressCandidate.attributes.Loc_name.search("ZIP4") > 0 || addressCandidate.attributes.Loc_name.search("Postcode") > 0) // US_ZIP4, CAN_Postcode { MainMap.scale = 20000; } else if (addressCandidate.attributes.Loc_name.search("Zipcode") > 0) // US_Zipcode { MainMap.scale = 40000; } else if (addressCandidate.attributes.Loc_name.search("City") > 0) // US_CityState, CAN_CityProv { MainMap.scale = 150000; } else { MainMap.scale = 500000; } //vboxlatlong.visible=true; var wgsmappoint:MapPoint = WebMercatorUtil.webMercatorToGeographic(addressCandidate.location) as MapPoint; //labellongitude.text = (wgsmappoint.x.toFixed(5)).toString(); //labellatitude.text = (wgsmappoint.y.toFixed(5)).toString(); labeladdressresult.text = "<b>Address Found:</b><br/>" + addressCandidate.address.toString(); // formated address //identify doIdentify(wgsmappoint); } else { //vboxlatlong.visible=false;// //labellongitude.text=""; //labellatitude.text=""; labeladdressresult.text = "<b><font color='#FF0000'>Found nothing !!</b></font>"; Alert.show("Sorry, couldn't find a location for this address" + "\nAddress: " + onelineaddress.text); }; } here is the doIdentify (without using any mouse click) private function doIdentify(mpoint:MapPoint):void{ //clickGraphicsLayer.clear(); //Alert.show("Hey" + mpoint.x.toString()); var identifyParams:IdentifyParameters = new IdentifyParameters(); identifyParams.returnGeometry = true; identifyParams.tolerance = 1; identifyParams.width = MainMap.width; identifyParams.height = MainMap.height; identifyParams.geometry = mpoint; identifyParams.mapExtent = MainMap.extent; identifyParams.spatialReference = MainMap.spatialReference; //Alert.show(mpoint.x.toString()); //var mappoint:MapPoint = new MapPoint(); //mappoint = mpoint; var clickGraphic:Graphic = new Graphic(mpoint, clickPtSym); clickGraphicsLayer.add(clickGraphic); identifyTask.execute(identifyParams, new AsyncResponder(myResultFunction, myFaultFunction, clickGraphic)); } results.length shows zero private function myResultFunction(results:Array, clickGraphic:Graphic = null):void { // Alert.show(" i m ahere result function "); Alert.show(" i m ahere result function " + results.length.toString()); if (results && results.length > 0) { var result:IdentifyResult = results[0]; var resultGraphic:Graphic = result.feature; //Alert.show(resultGraphic.attributes.toString()); switch (resultGraphic.geometry.type) { case Geometry.MAPPOINT: { resultGraphic.symbol = smsIdentify; break; } } lastIdentifyResultGraphic = resultGraphic; //paneltractresult.visible = true; } } Thanks Abu
... View more
04-01-2014
01:05 PM
|
0
|
10
|
2697
|
POST
|
Units: esriMeters Supported Image Format Types: PNG32,PNG24,PNG,JPG,DIB,TIFF,EMF,PS,PDF,GIF,SVG,SVGZ,BMP Document Info: Title: Author: Comments: Subject: Category: Keywords: AntialiasingMode: None TextAntialiasingMode: Force Supports Dynamic Layers: false MaxRecordCount: 1000 MaxImageHeight: 2048 MaxImageWidth: 2048 Supported Query Formats: JSON, AMF Min Scale: 1.47914381897889E8 Max Scale: 144447.638572
... View more
02-06-2014
11:54 AM
|
0
|
0
|
212
|
POST
|
HI: We build a cache layer for water body in web mercator> All Layers and Tables Layers: Major Lakes (0) All Waters (1) Description: Copyright Text: Spatial Reference: 102100 (3857) Single Fused Map Cache: true Tile Info: Height: 256 Width: 256 DPI: 96 Levels of Detail: 16 Level ID: 0 [ Start Tile, End Tile ] Resolution: 156543.03392800014 Scale: 5.91657527591555E8 Level ID: 1 [ Start Tile, End Tile ] Resolution: 78271.51696399994 Scale: 2.95828763795777E8 Level ID: 2 [ Start Tile, End Tile ] Resolution: 39135.75848200009 Scale: 1.47914381897889E8 Level ID: 3 [ Start Tile, End Tile ] Resolution: 19567.87924099992 Scale: 7.3957190948944E7 Level ID: 4 [ Start Tile, End Tile ] Resolution: 9783.93962049996 Scale: 3.6978595474472E7 Level ID: 5 [ Start Tile, End Tile ] Resolution: 4891.96981024998 Scale: 1.8489297737236E7 Level ID: 6 [ Start Tile, End Tile ] Resolution: 2445.98490512499 Scale: 9244648.868618 Level ID: 7 [ Start Tile, End Tile ] Resolution: 1222.992452562495 Scale: 4622324.434309 Level ID: 8 [ Start Tile, End Tile ] Resolution: 611.4962262813797 Scale: 2311162.217155 Level ID: 9 [ Start Tile, End Tile ] Resolution: 305.74811314055756 Scale: 1155581.108577 Level ID: 10 [ Start Tile, End Tile ] Resolution: 152.87405657041106 Scale: 577790.554289 Level ID: 11 [ Start Tile, End Tile ] Resolution: 76.43702828507324 Scale: 288895.277144 Level ID: 12 [ Start Tile, End Tile ] Resolution: 38.21851414253662 Scale: 144447.638572 Level ID: 13 [ Start Tile, End Tile ] Resolution: 19.10925707126831 Scale: 72223.819286 Level ID: 14 [ Start Tile, End Tile ] Resolution: 9.554628535634155 Scale: 36111.909643 Level ID: 15 [ Start Tile, End Tile ] Resolution: 4.77731426794937 Scale: 18055.954822 Format: PNG8 Compression Quality: 0.0 Origin: X: -2.0037508342787E7 Y: 2.0037508342787E7 Spatial Reference: 102100 (3857) Initial Extent: XMin: -1.2496799196541708E7 YMin: 1.93780585302807E7 XMax: 1.2566774517173149E7 YMax: 2.1332333283786736E7 Spatial Reference: 102100 (3857) Full Extent: XMin: -1.995191322781414E7 YMin: 1993522.8073695921 XMax: 2.0021888548445582E7 YMax: 1.1552449932964E7 Spatial Reference: 102100 (3857) Levels 13 , 14, and 15 are not visible in flex api application. But all other levels are shown in flex api application. <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:esri="http://www.esri.com/2008/ags" pageTitle="A tiled map service"> <esri:Map> <esri:ArcGISTiledMapServiceLayer url="http://m1-itmap01.frb.gov/arcgiswa/rest/services/frb/usa_water_with_labels_wm/MapServer"/> <esri:extent> <esri:Extent id="US" xmin="-18012000" ymin="1594000" xmax="-2358000" ymax="6760000" > <esri:SpatialReference wkid="102100"/> </esri:Extent> </esri:extent> </esri:Map> </s:Application> However using Javascript , http://m1-itmap01.frb.gov/arcgiswa/rest/services/frb/usa_water_without_labels_wm/MapServer?f=jsapi all layers are shown. please give a suggestion
... View more
02-06-2014
11:26 AM
|
0
|
2
|
605
|
POST
|
Is there a way to use two fields or attributes for classbreakrenderer for a featurelayer? It does not look like current api supports it. if not, can this be a suggestion for future api release.. Also is there a alternate way to use two fields using current api (of course not using two layers of the same feature layer). Thanks
... View more
07-24-2013
12:52 PM
|
0
|
3
|
754
|
POST
|
i created a web app (using flex api) that does batch geocoding. It loads an csv file into a datagrid, run the batch geocode, sends the addresses in an array and extract the result in a datagrid. It shows the result in the map. The app is using an address locator rest service deployed in our server from a composite address locator(it is not using any online address geolocator) However here is the issue: when the app geocodes about 200 records in a batch, it brings the result (about 1.5 minute) and loads all points to the grid and the map. when it tries to do geocode about 900 records, it keeps busy for about 2 minute and brings a error message ("unexpected < encountered at location 5" faultcode:null, faultdetail:null)..However if i try a second time, it brings same message. I try third time, it brings the results. It looks like when it errors out (i donot know exactly what error it is), it does not bring any record. but the records that are already geocoded, are in the cache memory. A second try brings more geocode results on the cache memory but since all records are not geocoded, it brings error message. A third try reaches these cache memory faster and does the remaining geocodes. I need to know is there a better way for batch geocoding: 1) whether any server side optimization 2) any way to catch the error before it is timeout and get the result that are being done 3) any other way to send the input (such as creating multiple tasks with smaller inputs). Thanks
... View more
06-19-2013
06:25 AM
|
0
|
0
|
497
|
POST
|
If you have 1.4 million points and you want to load these points for heat map (using mansour blog), is there a better a way to load these points? will other way be better (loading from server)? Thanks Abu Khan
... View more
06-12-2012
11:45 AM
|
0
|
0
|
1620
|
Online Status |
Offline
|
Date Last Visited |
yesterday
|