Select to view content in your preferred language

Javascript Viewer like the Flex Viewer with S/C

6072
15
Jump to solution
07-21-2015 08:38 AM
TonyCollins
Regular Contributor

Hi,

Is there a JavaScript version of the Flex Viewer that I can download and run locally and like the Flex version examine how it is built?

I have a large Flex based application (similar idea, but not based on the Flex Viewer) that I need to start to migrate into JavaScript.

Basically I would like to see the best way to structure a ESRI JS API based application, that can support the loading of external Tools/Modules similar to how the Flex Viewer does?

I hope this makes sense?

Thanks for any help

0 Kudos
1 Solution

Accepted Solutions
TimMcGee1
Frequent Contributor

Tony,

Take a look at the open source project CMV - Configurable Map Viewer and cmv/cmv-app · GitHub​ and cmv/cmv-contrib-widgets · GitHub

CMV is built on top of the ESRI JavaScript API (and Dojo) and uses your REST services much like the Flex API did. CMV can use AGO Services but does not require the use webmaps, AGO or portal.

In the last year I have converted dozens of Flex, Silverlight and ArcIMS sites for clients using CMV. If you visit GitHub or Stack Exchange, you'll see my name a lot. Through those early successes of converting customer's sites, I became one of the lead developers on the CMV project.

We have a core team of 4 developers and growing plus others that actively contribute support, documentation, functionality and widgets using GitHub, GIS StackExchange and group chat. We are about to release a new minor version with enhancements and support the latest version of ESRI's API (3.14). Parallel efforts are underway for the next major revision supporting the 4.0 release of the ESRI API.

Check it out and let me know if it fits your needs. And if not, I would certainly like to hear why not.

Hope this helps.

Regards,

Tim McGee

View solution in original post

15 Replies
AnthonyGiles
Honored Contributor

​Tony,

just ust be aware the web app builder requires a map id from either arcgis online or portal to work

Regards

Anthony

0 Kudos
TimMcGee1
Frequent Contributor

Tony,

Take a look at the open source project CMV - Configurable Map Viewer and cmv/cmv-app · GitHub​ and cmv/cmv-contrib-widgets · GitHub

CMV is built on top of the ESRI JavaScript API (and Dojo) and uses your REST services much like the Flex API did. CMV can use AGO Services but does not require the use webmaps, AGO or portal.

In the last year I have converted dozens of Flex, Silverlight and ArcIMS sites for clients using CMV. If you visit GitHub or Stack Exchange, you'll see my name a lot. Through those early successes of converting customer's sites, I became one of the lead developers on the CMV project.

We have a core team of 4 developers and growing plus others that actively contribute support, documentation, functionality and widgets using GitHub, GIS StackExchange and group chat. We are about to release a new minor version with enhancements and support the latest version of ESRI's API (3.14). Parallel efforts are underway for the next major revision supporting the 4.0 release of the ESRI API.

Check it out and let me know if it fits your needs. And if not, I would certainly like to hear why not.

Hope this helps.

Regards,

Tim McGee

ShaningYu
Honored Contributor

Tim:  Thanks for your response.  I downloaded the code (actually I downloaded the V3.11 version a while ago).  How I got a new problem.  When I opened the index.html on a browser, nothing displays except for the Banner.  Did I miss some steps? Thanks.

0 Kudos
TimMcGee1
Frequent Contributor

Hi Shaning,

Are you clicking on the index.html on your computer or are you using some web server (locally or on a server)?

From what you describe, it sounds like you are loading from a file on your computer. That will not work because it loads the JS API from a link that starts with "//js.argis.com...". There is no http: or https: protocol in front of it. That is intentional so the viewer can run as either http or https protocol depending on the web server configuration. Since you are using file://, it will attempt to use that protocol and fail. There are a number of way to address that but the easiest thing is to use a web server (IIS, Apache, nodejs, etc). Once you have the application running using one of those options, it will function just like the demo: http://demo.cmv.io/viewer/ which uses the exact same code that you downloaded.

If you have further questions, they are best posted as a github issue: Issues · cmv/cmv-app · GitHub  or a question at gis.stackexchange:. Newest 'configurable-map-viewer' Questions - Geographic Information Systems Stack Exchange

Hope this helps,

Tim McGee

0 Kudos
TonyCollins
Regular Contributor

Thanks for your help everyone, the CMV looks great but unfortunately I don't think this is what I am looking for?


I have build my own rest based backend map management system for the ESRI platform that I can plug my application(s) into. I can configure tools, services, users etc and I would simply (haha) like to wire up a JS API based application alongside the Flex app and in time migrate my (1k+) user base eventually.

Whilst I am not scared to move to something completely new if need be I would need to be able to understand it from the ground up to fix issues in a timely manor and integrate with existing business workflows.

Whilst we have several JS Apps already, they are simple compared to the Flex app and I was hoping to study a JS Viewer that had a widget/tool management system and that was not completely tied to AGS Online/Portal. Is there anything like that?

I'd love to use online but I am still to be convinced of it's benefits when I would need to host my bespoke apps on premise anyway?

Thanks again for any help,

Tony

0 Kudos
TimMcGee1
Frequent Contributor

HI Tony,

From your description, CMV sounds like it would fit the bill. I've done similar things in a former life so it sounds familiar. I am not here looking for work . Just suggesting I have a good understand of your issue.

I know of several developers who are using CMV in a manner much like you describe tied to centralized management of app configuration, services and app security, user/group roles, etc. I can (with your permission and theirs) get you connected to discuss how they have approached this. Let me know if that is of interest.

Regards,

Tim McGee

TonyCollins
Regular Contributor

Thanks Tim,

I have downloaded CMV and will have a look at how things hang together. Hopefully I can get my head around what is going on and maybe even contribute down the road.

In the system I would like to build, the tools/widgets are all moveable/resizable windows, much like photoshop or something. The widgets in CMV all look to want to sit in the left hand pane. Would I have to unpick a lot of code for widgets to behave like moveable windows?

Thanks

0 Kudos
RickeyFight
MVP Regular Contributor

Tony,

You can make some if not all movable.

If you click on the arrow to the right of the widget, the widget becomes detached and you can drag it around the screen as seen below.

You just need to set canFloat to true in viewer/js/config/viewer.js file.