POST
|
I was wondering if anyone could point me in the direction of a sample or examples of streetview working within a js api. Thanks Si Hi Simon, You can look at this document explaining an example of using a WMS layer in combination with streetview. This was an example of combining Google Streetview with locations coming from an other spatial reference an puting it into a dojo widget. Johnny http://jpenet.blogspot.be/2012/05/arcgis-javascript-api-using-google.html
... View more
03-19-2013
04:32 AM
|
0
|
0
|
710
|
POST
|
Hi Jef, Did you already test the use of WMS in API version 3.3. I have an application that loads WMS layers and until the API version 3.2 it works fine. Moving to API version 3.3 suddenly I had SRS/CRS missing in the getmap request as you stated earlier. I dynamically load layers. Until now I did not had a response from ESRI. Johnny
... View more
01-16-2013
11:17 AM
|
0
|
0
|
228
|
POST
|
Kelly, This is the code I use. One of the wms layers I use to test is http://grb.agiv.be/geodiensten/raadpleegdiensten/GRB/wms With 3.2 this works fine, with 3.3 it fails, no CRS . Spatial reference is 31370 I added extent at two places, add the version, but if still fails. As you can see all loading happens dynamically. I also added a log file maintained by the application. There you can see the URL generated for the WMS. Kind Regards Johnny var resourceInfo = { extent: new esri.geometry.Extent(baseLayer.WmsExtent.xmin, baseLayer.WmsExtent.ymin, baseLayer.WmsExtent.xmax, baseLayer.WmsExtent.ymax, { wkid: baseLayer.WmsExtent.spatialReference }), layerInfos: layerInfos }; mapLayer = new esri.layers.WMSLayer(baseLayer.RESTURL,{ resourceInfo: resourceInfo, extent: new esri.geometry.Extent(baseLayer.WmsExtent.xmin, baseLayer.WmsExtent.ymin, baseLayer.WmsExtent.xmax, baseLyer.WmsExtent.ymax, { wkid: baseLayer.WmsExtent.spatialReference }), visibleLayers: layerNames }); mapLayer.setImageFormat("png"); mapLayer.version = "1.3.0"; mapLayer.spatialReference = new esri.SpatialReference({ "wkid": baseLayer.WmsExtent.spatialReference }); handle = dojo.connect(mapLayer, "onError", function (err) { dojo.disconnect(handle); if (err.message) logging.logMessage("I", "*E* wmslayer initialize process failed. " + err.name + " - " + err.message, "gisOperation/_addNewWmsLayer"); else logging.logMessage("I", "*E* wmslayer initialize process failed. " + err, "gisOperation/_addNewWmsLayer"); }); try { map.addLayers([mapLayer]); } catch (e) { logging.logMessage("E", "wmslayer " + baseLayer.RESTURL + " add layer error. " + e.name + " - " + e.message, "gisOperation/_addNewWmsLayer"); }; Logging of the system 14/01/2013 - 18:29:58 - I - startup - getconfiguration start 14/01/2013 - 18:29:58 - I - startup - startup finished 14/01/2013 - 18:29:59 - I - addNewDynamicLayer - http://gisservices.inbo.be/ArcGIS/rest/services/Orthofoto/MapServer 14/01/2013 - 18:30:00 - I - mapModule - init finished 14/01/2013 - 18:30:00 - I - layer_Initialized - http://gisservices.inbo.be/ArcGIS/rest/services/Orthofoto/MapServer 14/01/2013 - 18:30:00 - I - mapModule - init - onload 14/01/2013 - 18:30:00 - I - addNewWmsLayer - http://grb.agiv.be/geodiensten/raadpleegdiensten/GRB/wms 14/01/2013 - 18:30:00 - I - addNewWmsLayer - http://wms.agiv.be/inspire/wms/adressen 14/01/2013 - 18:30:00 - I - addNewFeatureLayer - http://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer/1 14/01/2013 - 18:30:00 - I - addNewFeatureLayer - http://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer/2 14/01/2013 - 18:30:00 - I - gisOperation/_addNewWmsLayer - *E* wmslayer initialize process failed. Error - Kan afbeelding niet laden: http://grb.agiv.be/geodiensten/raadpleegdiensten/GRB/wms?SERVICE=WMS&REQUEST=GetMap&FORMAT=image/png&TRANSPARENT=TRUE&STYLES=&VERSION=1.3.0&LAYERS=GRB_BASISKAART,GRB_EXTRA&WIDTH=931&HEIGHT=493&BBOX=-105805.89676290829,96603.06298577916,386849.25521406263,357482.75141182285 14/01/2013 - 18:30:00 - I - featureLayer_Initialized - http://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer/1 14/01/2013 - 18:30:00 - I - featureLayer_Initialized - verify end of layers loaded - http://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer/1 14/01/2013 - 18:30:00 - I - featureLayer_Initialized - http://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer/2 14/01/2013 - 18:30:00 - I - featureLayer_Initialized - verify end of layers loaded - http://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire/FeatureServer/2 14/01/2013 - 18:30:00 - I - All layers initialized. - verifyInitialisationMap 14/01/2013 - 18:30:00 - I - All layers added to the map. - verifyInitialisationMap 14/01/2013 - 18:30:00 - I - mapModule - execute mapLoaded 14/01/2013 - 18:30:00 - I - mapModule - init - initEditing 14/01/2013 - 18:30:01 - I - eventAggregator-publish - mapLoaded - legendBuild 14/01/2013 - 18:30:01 - I - legendModule - start legend build 14/01/2013 - 18:30:01 - I - legendModule - build legend done 14/01/2013 - 18:30:01 - I - eventAggregator-publish - legendBuild - selectBuild 14/01/2013 - 18:30:01 - I - layerSelectionModule - start layer selection build 14/01/2013 - 18:30:01 - I - layerSelectionModule - end layer selection build
... View more
01-14-2013
07:56 AM
|
0
|
0
|
341
|
POST
|
Hi, Changing from API 3.2 to 3.3,using WMS layers no longer worked. The base layer has a spatial reference of 31370 and my WMS layers has the same spatial reference. Using Fiddler I noticed that CRS is no longer provided using the REST service getmap. In version 3.2 the WMS layers worked and the CRS is provided. In both case I used the resourceInfo option and no proxy is used. Has someone any idea what has been changed in 3.3 for using WMS layers?
... View more
01-13-2013
11:52 PM
|
0
|
3
|
768
|
POST
|
Hi niranjan, I did some work on converting between projected systems in javascript. I put this information into a blog http://jpenet.blogspot.be/2012/08/transformation-between-datums-in.html , including JavaScript code that bypass the use of geometry services for transformation of projections. First document explains the conversions needed, the second illustrate this with javascript code. I hope this can help you. Johnny
... View more
01-12-2013
02:24 AM
|
0
|
0
|
1478
|
POST
|
Demin, I only doing ArcGis the last 4 years, before I meanly developped .NET applications where it is common to use design patterns. This is why when I started the migration of the Web ADF, I first looked at a way to create a layered application. For Silverlight I had the change to start with PRISM 4.0 which does a lot the help creating application which separates the GUI from the business (MVVM). The only negative is that it takes a lot of study to embrase the ideas behind the PRISM library. But once you endorse the patterns, creating tools and command takes little development time. PRISM contains all the modern development patterns like dependency injection, component container. All components are interface driven. When I decided to the job over in Javascript, I looked how could I have something simular as PRISM for helping doing MVVM. In the Microsoft Develop world, a lot of people use knockoutJS as the library for doing MVVM. In Silverlight my GIS components where all singleton, and DOJO helped me doing the same pattern. In the GIS components I simply copied the interfaces and developped the code, in some case I even copied the C# code and modified it to match the JavaScript API. The major work to be done for the migration was on the GUI side, and this is not the strongest part in Javascript. Dojo components as tab controls and accordion are compatible with knockoutJS. The goal was to have a page that consists of different independ components. Legend, toolbars are all independed components that can be replaced or removed. The conclusion is that you can use the same patterns found in Silverlight also in Javascript to create very maintainable applications. It is possible to ban all javascript code out of the HTML pages so that more experienced GUI designers can do the GUI job.
... View more
01-07-2013
01:10 PM
|
0
|
0
|
696
|
POST
|
I think "Silverlight is Dead" is very misleading. It is a very big topic and there are lots of good articles on Google talking about it so i don't want or am not capable to explain well. I think Javascript and Sliverlight technologies complement each other. I would like to make use of both strength. As a matter of fact, I had developments a silverlight app using Google Map API. The interaction between Javascript and silverlight are so easier.... Demin, Wat I meant with Silverlight is that no new versions are expected. Microsoft moved the core development team of Silverlight to other projects. So in the future more and more browsers will no longer support plugins like Silverlight. For intranet applications Silverlight will stay for a long time as you have your desktop configurations in hand. Internet applications however follow the new technologies. Example of product decissions is Adobe which no longer releases new version of flash for the mobile devices. Already Microsoft and Google have requested extension on HTML 5 for a richer multi media platform. It is also a question how long (years) ESRI will release new Silverlight and Flex versions of their API. Why ESRI stopped their Web ADF in the first place? Unfortunally software makers not always looks at the installed base, but rather at what will bring the future. Johnny
... View more
01-07-2013
06:15 AM
|
0
|
0
|
696
|
POST
|
I have very similar programming experiences as Heming, I agree with all of his opinions, but I am not so comfortable with Javascript as he does. It might possible to develop SOE, MVVM applications with Javascript, I looked Johnney's blog, his blog inspired me a lot with Javascript on GIS, but consider the time, team resource, however I don't think I will easily take Javascript as an option for our enterprise applications now, but I will use them for some easy functionlities which could be public. All ESRI APIs are good, there is no one over another from my opinion, we just need to select the right ones for the specific application requirements. Demin, I agree about the statement about development resources, however at long term it will not be a discussion of using Silverlight / Flex or Javascript for web based application but rather choose between JavaScript and native applications for mobiles (IOS / Android Win 8?). Silverlight is at a dead end for Microsoft, still they will support it for a long time. Flex has been put in open source, clearly an exit strategy of Adobe. So the days for browser plugins are counted. Javascript will have more support from Microsoft in Visual Studio 2012, unfortunaly for us ArcGis guys Microsoft choose JQuery as their favorite library. So investments into Javascript will be very important if you need doing web applications. Johnny
... View more
01-07-2013
05:15 AM
|
0
|
0
|
696
|
POST
|
I have a street layer with each street segment and I need to find the closest one to a particular lat-lon (sort of reverse geocoding but without the locator .. I don't have one) - Back on arcims I used to do incremental buffers till I got to a street segment but it sounds inefficient... any idea? Walter, You can do it with a geoprocessing task with all processing at the server but this involves some constraints to fullfill. Another way is doing most of the job in javascript requiring no geoprocessing task. This is the way it can be done: 1. Select all the polylines involved, this can be done using a spatial query on the feature layer with the polylines (streets). You must select an extent, this could be the extent of the map showed. 2. Loop through all the polylines and within a polyline loop through all lines (paths) 3. For each path calculate the distance between the point and the line. Maintain the minimum distance found 4. At the end of both loops, you have the resulting polyline The only difficulty consist of calculating the distance between a point and a line. Below you find code that I retrieved from the internet. Another item of attention is that you need to convert lat / lon to geometry coordinates. For this you can use esri.geometry.geographicToWebMercator method The only limitation to this kind of approach is that You must limit the number of polylines involved. Here is some javascript code reflecting some old school mathematics: function sqr(x) { return x * x } function dist2(v, w) { return sqr(v.x - w.x) + sqr(v.y - w.y) } function distToSegmentSquared(p, v, w) { var l2 = dist2(v, w); if (l2 == 0) return dist2(p, v); var t = ((p.x - v.x) * (w.x - v.x) + (p.y - v.y) * (w.y - v.y)) / l2; if (t < 0) return dist2(p, v); if (t > 1) return dist2(p, w); return dist2(p, { x: v.x + t * (w.x - v.x), y: v.y + t * (w.y - v.y) }); } function distToSegment(p, v, w) { return Math.sqrt(distToSegmentSquared(p, v, w)); } The issue you raised here is very interesting. I hope one day to add it as a tool to my JavaScript Framework that can be found in my blog. The concept explained above can easy be extended for polygons. (see http://jpenet.blogspot.com) Johnny
... View more
01-06-2013
11:56 AM
|
0
|
0
|
1028
|
POST
|
I just start to learn Javascript API, but I will not change what I am doing for now. I may use Javascript API for very simple applications in my work. I wonder how people feel about Javascript API for the enterprise applications : service-orienteted, multiple-tire architecture, Model-view-view model design pattern etc. and how people sure html5 is really going to work on all browsers and when it could. I really like to know GIS developer's experiences on these issues. I started writing an ArcGis framework in Silverlight for a customer as a replacement of web ADF. I choose using Microsoft PRISM to support the MVVM pattern in writing Gis applications in Silvelright. Later I used the patterns found in PRISM for converting the framework written in C# into a JavaScript framework for building GIS applications. To support MVVM I used the knockoutJS library which works pretty well with DOJO. A pattern like dependency injection and the use of containers can be more or less implemented using AMD. I put the whole process of the Silverlight framework and the JavaScript framework on my blog http://jpenet.blogspot.com , it is not perfect and complete put could give you an idea how you can move from the ArcGis web ADF into an own library driven template of GIS applications. It also shows how you can easily integrate other API's as Google to GIS applications.
... View more
01-04-2013
10:30 AM
|
0
|
0
|
879
|
POST
|
As you showed here, myMap will be created but with empty parameters by AMD, which is not usefull and will fail because a node is mandatory, you need a node as you showed in the postCreate. If you want to create a new class you must replace "esri/map" by [esri/map] and remove myMap from the list of arguments) It is not clear the purpose of "core_library/_Widget" Hi All, I wanted to know in following code why we have to instantiate map as new esri.Map() and not as new myMap() define(["dojo/_base/declare", "core_library/_Widget", "esri/map"],
function (declare, WidgetBase, myMap) {
return declare([WidgetBase], {
_map: null,
postCreate: function () {
this._map = new esri.Map(this.domNode, { extent:initExtent,slider: true });
}
});
});
... View more
12-16-2012
01:02 AM
|
0
|
0
|
272
|
POST
|
The usual way to handle a demand of accessing a SQL server outside ArcGis server is to write a REST service at a web server that will handle the request and returning data. In JavaScript you can easily consume such a request by code like this base on JQuery $.ajax({ cache: false, type: "POST", async: false, url: �??rest service url�?�, crossDomain: true, data: JSON.stringify(data), contentType: "application/json;charset=utf-8", dataType: "json", processdata: true, success: function (data) { if (!status) alert("data retrieve failed"); else �?�.. data handling }, error: function (xhr) { alert(xhr.responseText); } }); Writing REST services is not an ArcGis API issue, but pure writing web services. Currently I am writing a custom graphic layer class that will consume non ArcSDE geometry tables like the SQLGeometry of MS SQL server. I hope later to make the code available. The REST service is written using .NET
... View more
12-09-2012
11:33 AM
|
0
|
0
|
433
|
POST
|
Hi Christian, I am not sure there is an easy way in Javascript for converting local geographic coordinates into projected coordinates. Having problems of converting WGS84 to Lambert 72 (31370), I wrote a number of javascript methods that did the job. One of the methods was the conversion between geographic and projected coordinates for Lambert 72. I think you will need something simular. After some research, I used the conic conformal 2SP (Belgium) method, you will need 'JHS formulas' that can be found in the document http://www.epsg.org/guides/docs/G7-2.pdf You can find a lot of documentation and code on a blog I wrote concerning conversions of projections in Javascript. First document is about the architecture. Second document contains the code. I hope the documents are easy readable. http://jpenet.blogspot.be/2012/08/transformation-between-datums-in.html Johnny
... View more
08-22-2012
03:31 AM
|
0
|
0
|
616
|
POST
|
For those who are interested, you can find my projection transformation adventure here, contains also some hints to write your own local transformation. : http://jpenet.blogspot.be/2012/08/transformation-between-datums-in.html
... View more
08-16-2012
07:19 AM
|
0
|
0
|
891
|
POST
|
Solved the problem by writing a transformation in Javascript, not an easy task. I had to read a lot of pages concerning projection transformations, lucky I am a mathematician. For doing a transformation of WGS 84 to Lambert 72 (31370) I had to program the following steps : 1. Convert WGS 84 geographic coordinates to Geocentric coordinates 2. Perform Bursa-Wolf transformation based on Helmert 7 parameters of Lambert 72 for geographic transformation 3 Convert geocentric coordinates to geographic coordinates 4. Perform a Lambert conic conformal SP2 (Belgium) transformation to get Lambert 72 projection coordinates. Doing so has the advantage that no async operation is required on a rest service. The most tricky point is step 4. It depends on the local projection required.
... View more
08-04-2012
03:33 AM
|
0
|
0
|
891
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|