GithubHelp home page GithubHelp logo

Comments (8)

andygup avatar andygup commented on June 23, 2024

@AminBangash since your question is about the ArcGIS API for JavaScript it's best to post those questions on GeoNET: https://community.esri.com/community/developers/web-developers/arcgis-api-for-javascript.

For referencing a local file you need a url such as: https://localhost/test.csv. I believe you'll also need a valid SSL certificate or you'll get an error.

Another option is to host your csv in a github repo for testing purposes.

[Edit]

One other option for testing is to use a simple CSV string as shown in this codepen: https://codepen.io/andygup/pen/LYGRqYj?editors=1000

from angular-esri-map.

AminBangash avatar AminBangash commented on June 23, 2024

@AminBangash since your question is about the ArcGIS API for JavaScript it's best to post those questions on GeoNET: https://community.esri.com/community/developers/web-developers/arcgis-api-for-javascript.

For referencing a local file you need a url such as: https://localhost/test.csv. I believe you'll also need a valid SSL certificate or you'll get an error.

Another option is to host your csv in a github repo for testing purposes.

[Edit]

One other option for testing is to use a simple CSV string as shown in this codepen: https://codepen.io/andygup/pen/LYGRqYj?editors=1000

thanks andy for your response, but my file is located inside a local drive like C: or D: so i can't use http as it is for a server.

from angular-esri-map.

AminBangash avatar AminBangash commented on June 23, 2024

my url is like for csvlayer on local c:drive, i.e
csvUrl="file://C:Users\Desktop\test.csv"

let csv =new CSVLayer({
url: csvUrl,
renderer: csvRenderer //for drawing point
})
map.add(csv)

from angular-esri-map.

andygup avatar andygup commented on June 23, 2024

Hey @AminBangash yes, you'll need to use the same approach as demonstrated in the codepen above: create a blob from the file input and use that value in the CSVLayer.url property. Here's another codepen that demonstrates the concept: https://codepen.io/andygup/pen/KKVNXGV?editors=1000.

To test it, create a test.csv file using this data:

time,latitude,longitude,desc
2019-06-28T11:17:31.734Z,39.0,-104.8409,'test'

from angular-esri-map.

AminBangash avatar AminBangash commented on June 23, 2024

Hey @AminBangash yes, you'll need to use the same approach as demonstrated in the codepen above: create a blob from the file input and use that value in the CSVLayer.url property. Here's another codepen that demonstrates the concept: https://codepen.io/andygup/pen/KKVNXGV?editors=1000.

To test it, create a test.csv file using this data:

time,latitude,longitude,desc
2019-06-28T11:17:31.734Z,39.0,-104.8409,'test'

Thank you very much @andygup you make my day. :)

from angular-esri-map.

AminBangash avatar AminBangash commented on June 23, 2024

Hey @andygup if i have to upload multiple files, will it plot like that?

from angular-esri-map.

andygup avatar andygup commented on June 23, 2024

Not automatically, you'll need to write the code to handle that.

I'm going to close this issue @AminBangash since the original question has been answered and it's not related to Angular. If you have follow-up questions related to JavaScript and the ArcGIS API for JavaScript the best place to post them is on GeoNET.

Please note: this repository is now retired and will soon be archived. It's been replaced by modern alternatives - more info can be found here.

from angular-esri-map.

AminBangash avatar AminBangash commented on June 23, 2024

Not automatically, you'll need to write the code to handle that.

I'm going to close this issue @AminBangash since the original question has been answered and it's not related to Angular. If you have follow-up questions related to JavaScript and the ArcGIS API for JavaScript the best place to post them is on GeoNET.

Please note: this repository is now retired and will soon be archived. It's been replaced by modern alternatives - more info can be found here.

Thanks @andy for your help. I have posted my question there.

from angular-esri-map.

Related Issues (20)

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.