Giter Club home page Giter Club logo

cmv-widgets's People

Contributors

brianbunker avatar darinatch avatar friendde avatar green3g avatar tmcgee avatar tr3vorm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cmv-widgets's Issues

Adding service in layer control through dnd widget

Hello Brian,

I am using your dnd widget to add shape file and services. Is it possible to show the added service in the layer control menu? The purpose is to turn on/off the layers in the service.

Thanks

Navigation Hash Widget Error in Google Chrome Browser

@BrianBunker

When using Google Chrome to access an application that implements the Navigation Hash widget there is an error when you attempt to open a new tab in the browser window and access another URL that has a Navigation hash reference. I have tested this issue in other browsers, but have only been able to recreate it in Google Chrome. The error occurs almost every single time, but on occasion will not.

In #740 I list the following steps to recreate this issue:

  1. Open the application in Google Chrome using the following public URL.
  2. Open a new tab in the same browser window.
  3. Paste the public URL from step 1 into the address bar and hit enter.
  4. There are no errors in the browser console.

The map should zoom to the same extent in the second browser tab as it does in the first browser tab. Rather what you will see is that in the second browser tab the latitude and longitude has been ignored, and that the map is instead zoomed to the extent of the map center using the specified zoom from the Navigation Hash widget.

Any help to resolve this issue would be excellent!

Filename case sensitivity

Many thanks Brian - one small problem I just came across was that the file name suffix is case-sensitive, so my filename.CSV did not work until I renamed it filename.csv. I haven't checked if this is the same for other file types (shp etc).

DnD.js file line 473

I have to use https if i deploy this to a server that is only allow https traffic. Otherwise the drop kml does not work.

merge csv to the existing featurelayer

Is there anywhere I can find from dnd.js as a variable which contains the url of featurelayer as below (operational layer) in Viewer.js

layer1

Because I am trying merge the csv data to the existing feature layer, and I have to grab the url of the exiting featurelayer. I am trying to use the following at Line 386. It seems not working
layer2

Controlling the layer list on the Nearby Widget

Currently, the Nearby widget will auto populate all layers and sublayers (with data) listed in the viewer.js. Could we change the code so that we could have more control over which layers we include in the Nearby widget? From the Nearby.js file it seems this function creates the drop-down list:

populateLayerSelect: function () { var options = []; array.forEach(this.map.layerIds, lang.hitch(this, function (layerId, i) { if (i !== 0) { if (this.map.getLayer(layerId).layerInfos && this.map.getLayer(layerId).layerInfos.length > 0) { array.forEach(this.map.getLayer(layerId).layerInfos, lang.hitch(this, function (layerInfo, j) { // check to exclude the group layers as they do not contain features if (!layerInfo.subLayerIds) { options.unshift({ value: layerId + ':' + j, label: layerInfo.name }); } })); } else if (this.map.getLayer(layerId).name) { options.unshift({ value: layerId + ':', label: this.map.getLayer(layerId).name }); } } })); this.nearbyFeaturesSelect.addOption(options); this.setupSelectionLayers(this.nearbyFeaturesSelect.get('value')); },

Any quick pointers on how we might approach this would be helpful. If it would be a complex task, that insight would also be helpful. Thank you!

Nearby Widget - feature layer support

Can the Nearby widget be configured to summarize features that are loaded in CMV as a "feature" layer? It looks like the widget's default action is to only list dynamic layer types in the "Summarize features from" pick list. Thanks.

Pad MGRS coords with zeros to align with arcgis

When entering anything less than a 10 figure mrgs coordinate the goth widget appears off compared to data created in arcgis. I have traced this issue to arcgis automatically padding anything less than a 10 figure grid with zeros, where as goto simply places the point in the centre of the grid square, thus making the data and goto misalign. Any solution to this would be greatly appreciated.

How to change the blue ICON in the Drag and Drop when you use the CSV files?

Hello, I must change the icon to other symbol like way points smaller that the icon blue, Do you think its possible and where i must change i try many things nothing change? Also by the simple fact to be able to change the icon on that function, we will be able to drag two list of points and compare between these points, overlap , near bad points etc...
draganddropsymbol
...
Many thanks for your collaboration!

Dnd Widget import

Hello, can I Import A geo-referenced image (tif) with this plugin ? if not is there a possibility to do it ?

Adding shape files

Hi,

I tried adding the shape files you have provided but it doesn't seem to work. Can you please check?

Thanks

Projected Coordinates in URL

Hi @BrianBunker. The widget you've coded is exactly the solution i've been looking for, but I'm encountering a problem with projection.

My basemaps and layers all use the EPSG: 27700 (British National Grid). When I attempt to use the widget, the URL contains a static, meaningless co-ordinate and tile scale reference (#/4.1782/4.6218/2).

The browser error received for the mis-display is "Map: Geometry (wkid: 4326) cannot be converted to spatial reference of the map (wkid: 27700)".

Would I be correct in assuming that the widget does not support projected coordinate systems? And if this is the case, would it be of interest to include this functionality in the near future?

nearby widget error

hi, I am very glad to see here is a widget with the functionality of your Nearby. thank you for such great widget. i would appreciate if you could help me with this issue:
i added it to my app-based on latest cmv- and i get an error in cannot read property toFixed of undefined at line nearby.js:501:60
here
i only want to use the distance part (not the drive time part) of the widget.
it is curious that the number of errors is equal to number of objects that exist in the radius.

identify after add a mapserver service

Hi, Brian:

Can you give me some hint on where do i make change in your code so that i can let user to identify feature after they drop a mapserver service on demand?

Thanks a lot.

Drive time polygon does not show on the map when custom map is used for a basemap (Nearby widget)

Hi Brian,
I am using our own basemaps and they have a spatial reference different than the ArcGIS online maps. When using the drive time functionality, the drive time polygon does not show on the map, because of the spatial reference differences.

I made some changes to Nearby widget to perform project on the resulting polygon, so it matches the map's spatial reference.

Below is the code, and if you think this might be of interest, I will do a pull request.

doNearbyAnalysis: function() {
            // which mode is selected? distance or drive time
            // get a geodesic circle or a drivetime polygon
            this.nearbyArea = null;
            if (this.nearbyMode === 'distance') {
                // what is the distance radius value?
                this.nearbyArea = new Circle({
                    center: this.pointGraphic.geometry,
                    geodesic: true,
                    radius: this.nearbyValueInput.get('value'),
                    radiusUnit: Units[this.nearbyModeDistance_options.get('value')]
                });
                this.selectNearbyFeatures();
                this.nearbyResultsNode.innerHTML = '';
            } else if (this.nearbyMode === 'drivetime') {
                // what is the drivetime radius value?
                this.drivetimeUI(true);
                request({
                    url: 'http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Network/USA/NAServer/Service%20Area/solveServiceArea',
                    content: {
                        facilities: '{"features": [{"geometry": ' + JSON.stringify(this.pointGraphic.geometry.toJson()) + '}]}',
                        defaultBreaks: this.nearbyValueInput.get('value'),
                        f: 'json'
                    },
                    handleAs: 'json',
                    callbackParamName: 'callback'
                }).then(lang.hitch(this, function(result) {
                    this.drivetimeUI(false);
                    // THIS IS THE CHANGE - added the if statement
                    if (result.saPolygons.spatialReference.wkid === this.map.spatialReference.wkid) {
                        this.nearbyArea = new Polygon(result.saPolygons.features[0].geometry);
                        this.selectNearbyFeatures();
                    } else {
                        this.projectDriveTimePolygon(result.saPolygons.features[0].geometry, result.saPolygons.spatialReference);
                    }
                }), lang.hitch(this, function(err) {
                    this.drivetimeUI(false);
                    this.nearbyResultsNode.innerHTML = 'Sorry, couldn\'t get drive time area. Try a shorter time or a location near a road. If the problem persists, the service might be down temporarily.';
                }));
            }
        },

projectDriveTimePolygon: function (polygonGeometry, inSR) {
            var outSR = new SpatialReference(this.map.spatialReference.wkid);
            var polygon = new Polygon(inSR);
            polygon.rings = polygonGeometry.rings;

            this.geometryService.project([polygon], outSR).then(lang.hitch(this, function (projectedPolygons) {
                this.nearbyArea = projectedPolygons[0];
                this.selectNearbyFeatures();
            }), lang.hitch(this, function (err) {
                this.nearbyResultsNode.innerHTML = 'Error occurred while reprojecting the drive time polygon';
            }));
        },

Goto widget

thanks for the wonderful widget, just a feature request, is it possible to add a balloon point (just like google map) when user click the Go button? right now the widget just center the map to the point.

Let me know where should i look into it to add that.

Thanks again.

Add another coordinate system ?

Hi Brian,
I have this tool added in my app, It is working fine.
I would like to add one more coordinate system (QND 1995) option and zoom to coordinates.
I tried to look into Coordtypes.js file but couldn't get it.
Is there way to add another coordinate system to widget like below ?

WKID : 2932
NAME : QND_1995_Qatar_National_Grid

SPATIAL REFERENCE INFO :

PROJCS["QND_1995_Qatar_National_Grid",GEOGCS["GCS_QND_1995",DATUM["D_QND_1995",SPHEROID["International_1924",6378388.0,297.0]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",200000.0],PARAMETER["False_Northing",300000.0],PARAMETER["Central_Meridian",51.21666666666667],PARAMETER["Scale_Factor",0.99999],PARAMETER["Latitude_Of_Origin",24.45],UNIT["Meter",1.0]]

Thanks,
Mayur

Generate Operation

Does the Generate operation (to create feature collection from csv file,...) work with ArcGis server Installation? Or it needs portal for ArcGis?
I need to replace sample link! with my Local server.
Thanks

Where Can I change Icon Image

I was trying to replace the icon images when I dragged the points into the map but could not find the location. Anybody can show me?

Thanks

I try the KML drag and drop compatibilities? no success

Hello Tim,
Thanks for your work for the kml drag and drop
I copy all the code on my server and i try ,
The Browse file don't see the KML, so i put in the DnD,html the type file .kml in two files
after now i see the kml but they dont Open?

and i save...After i try many kind of kml and the one in your sample data, i don't know what is wrong?
Take a look of my screen shot...Thanks again for your time and effort...
YOU MUST TRY YOUR SELF ON THAT LINK,,,
http://gis.icao.int/kmltmc/#/-99.8916/38.4939/4
The csv work and the shp but the cctv.kml doesn't work but work in Google Earth
kml1
kml2

Map: Geometry (wkid: 4326) cannot be converted to spatial reference of the map (wkid: 2932)

Hi @BrianBunker @tmcgee @roemhildtg,

I am getting the Spatial reference error in Goto Coordinate widget.

Map: Geometry (wkid: 4326) cannot be converted to spatial reference of the map (wkid: 2932)

below is my map options in viewer.js file

mapOptions: {
            navigationMode: 'classic',
            zoom: 10,
            sliderStyle: 'small',
            showLabels: true,
            extent: new Extent({
                xmax: 230766.87022996417,
                xmin: 230423.22107394566,
                ymax: 392078.99689069286,
                ymin: 391844.8197423016,
                spatialReference: {
                        wkid: 2932
                }
            })
        }

goto

The error in Goto.js file at gotoCoordinate function this.map.centerAt(latlongCoord);
The map is not Zoomin to the location and no marker pin added on map.

This is what I tried to do in _setGraphicCoordinateAttr method but it did not work :

if (coordinate) {
                var point = new Point(coordinate, new SpatialReference({
                    wkid: 4326
                }));
                debugger;
                // start project parameters
                var projectParams = new ProjectParameters();
                projectParams.geometries = [point];
                projectParams.outSR = new SpatialReference(2932); //{ wkid: 3857 }; //4326;//this.map.spatialReference;
                //projectParams.transformation = {
                //    wkid: 2932
                //};
                //projectParams.transformationForward = true;
                var defer = esri.config.defaults.geometryService.project(projectParams).then(lang.hitch(this, function (projectedGeometry) {
                    debugger;
                    if (projectedGeometry.length > 0) {
                        this.graphic.setGeometry(projectedGeometry[0]);
                        this.graphic.show();
                    }
                }));
                this.graphic.setGeometry(point);
                this.graphic.show();
            }

Thanks,

DroppedItem.js VS. DnD.js

I am trying to add a button to the current drapanddrip dialog. The action is when I click on the button a event will be triggered. But I got lost on the current js structure. I saw there are two js files DroppedItem.js and DnD.js. Which on should I focus on?

Thanks

Keep the point on the map

Hello!

Is possible in your widget show the graphic point and keep it on the map? when I refresh the application the point desapear... is it possible? explaining ... I need to look for a coordinated and pin point then look for another coordinated and the previous point remains on the map ...only when I refresh the map the graphics, all the points desapear...

Thanks

Renato

DnD and custom basemaps

I have just discovered that I cannot add CSV files to custom basemaps (e.g. NZTM SRID=2193), however adding shapefiles seemed to work fine. I tried with both geographic and rectangular coordinates.

A quick and dirty fix for me was to just remove the transformation from the following on line 579 (my version may be out of date).
var geometry = webMercatorUtils.geographicToWebMercator(new Point(longitude, latitude));
so that it just used the raw basemap coordinates (rectangular).
var geometry = new Point(longitude, latitude);

I am trying to get my head around what is expected, and how I can make a more permanent fix. Do I just need to make the changes in the processCVSData() function? Typically, users like to add lists of WGS-84 geographics coordinates from a GPS.

Geo-tagged Image

When draging and droping a geo-tagged image, it doesn't get placed on its proper location. it seems, the widget doesn't take the position of the image into account.

Getting all map layers

@tmcgee I am trying to get all the layers using map.layerIds.length and then iterating through them. It gives me all the layers except from the ones added through DnD widget. How can I get those layers?

Also, The layers added through DnD doesn't move up or down with respect to already added operational layer. Can you please help me?

Thanks

DnD w/ beta.2

Some fixes for removing layers DnD on beta.2:
DnD.js
add around line 242 - this.droppedItems[file.name].setLayerIds([ this.createLayerID('csv-' + file.name)])
add around line 336 - this.droppedItems[url].setLayerIds([layer.id]);
edit around line 680 - id:this.droppedItems[filename].getLayerIds()[0]
LayerControl.js
add around line 239 - try {layerControl._scaleRangeHandler.remove();
}catch(err){}

Insert active map layers in URL?

Nice tool, thanks for sharing. Do you have any plans to add functionality that captures the active visible map layers in the URL, in addition to the map center and zoom? By adding the active layers to the URL, then the user could easily share the URL and be assured the recipient will see the exact same map view. Thanks again for the contribution.

updateLocationHash triggers map.centerAndZoom

First, nice widget, This is really useful!

One small issue me is after the map is panned or zoomed, it loads as expected, but then it adjusts a few pixels and reloads again. I'm not 100% sure if this is the issue, but what appears to be happening is when hash is called hashUpdating seems to get set to false before the hash changes.

So what ends up happening is:

  1. User pans map
  2. Map reloads
  3. Hash changes
  4. Map centers and zooms onHashChange
  5. Map reloads again

I'm not positive on this but maybe the hash function in dojo/hash is async and this.hashUpdating gets set to false too quickly?

Prevent Identify when Dropping a Point

I would like to utilize this widget but when I add it to the viewer and attempt to drop a point the identify executes and seems to prevent the analysis from occurring. The buffer draws but no features are returned. Thanks in advance for any help you can provide!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.