Comments (14)
@ERS-Long, are you able to provide a live example of this on a public site?
If not, can you provide your config for the widget?
Also, are you using the latest version of the widget?
from cmv-widgets.
Hi, @roemhildtg:
My site is still in our internal server, so i cannot share it.
but here is the config settings:
settings: {
include: true,
id: 'settings',
position: 17,
type: 'titlePane',
canFloat: true,
path: 'gis/dijit/AppSettings',
title: '<i class="icon-large
icon-paper-clip"> Save/Share Current Map',
options: {
//required:
map: true,
layerControlLayerInfos: true,
//optional (defaults shown):
appSettings: {},
parametername: 'cmvSettings',
mapRightClickMenu: true,
address: '[email protected]',
subject: 'Share Map',
body: 'Check out this map! <br /> ',
emailSettings: ['saveMapExtent', 'savelayerVisibility'],
shareNode: null,
shareTemplate: '<a href="#"><i class="fa fa-fw
fa-envelope-o">Share Map',
server: null
}
},
Yes, I download the latest widget from the github yesterday.
Thanks a lot,
Long
On Thu, May 7, 2015 at 6:53 AM, roemhildtg [email protected] wrote:
@ERS-Long https://github.com/ERS-Long, are you able to provide a live
example of this on a public site?If not, can you provide your config for the widget?
Also, are you using the latest version of the widget?
—
Reply to this email directly or view it on GitHub
#9 (comment)
.
from cmv-widgets.
Hi @ERS-Long, can you also tell me what types of layers you are using? It would probably be helpful to see your operationalLayers array in your config file. The URL's aren't important so you don't have to include them as they are internal anyways.
from cmv-widgets.
Hi,
roemhildtg
Thanks a lot.
Here is the layer config portion.
{
type: 'dynamic',
url: '
https://gis.eparm.net/eparmgis/rest/services/R6Secure/RMP_PDO/MapServer',
title: 'R6 RMP Facilities',
options: {
id: 'R6RMPFacilities',
opacity: 1.0,
visible: false,
imageParameters: imageParameters
},
identifyLayerInfos: {
layerIds: [2, 3, 5, 6, 8, 9, 10]
},
layerControlLayerInfos: {
metadataUrl: true
}
},
{
type: 'dynamic',
url: '
https://gis.eparm.net/eparmgis/rest/services/R6Facilities/FRP_R6_Service/MapServer
',
title: 'R6 FRP Facilities',
options: {
id: 'R6FRPFacilities',
opacity: 1.0,
visible: false,
imageParameters: imageParameters
},
identifyLayerInfos: {
layerIds: [0, 1]
},
layerControlLayerInfos: {
metadataUrl: true
}
},
{
type: 'dynamic',
url: '
https://gis.eparm.net/eparmgis/rest/services/R6Secure/Cerclis/MapServer',
title: 'Field Activities',
options: {
id: 'FieldActivities',
opacity: 1.0,
visible: false,
imageParameters: imageParameters
},
identifyLayerInfos: {
layerIds: [0, 1]
},
layerControlLayerInfos: {
metadataUrl: true
}
},
On Thu, May 7, 2015 at 9:30 PM, roemhildtg [email protected] wrote:
Hi @ERS-Long https://github.com/ERS-Long, can you also tell me what
types of layers you are using? It would probably be helpful to see your
operationalLayers array in your config file. The URL's aren't important so
you don't have to include them as they are internal anyways.—
Reply to this email directly or view it on GitHub
#9 (comment)
.
from cmv-widgets.
I just found the bug. I wasn't having any issues, but after pasting the config from the documentation, I experienced the same issue. There was a typo in the documentation config, in the option for emailSettings, savelayerVisibility should be changed to saveLayerVisibility
emailSettings: ['saveMapExtent', 'saveLayerVisibility'],
Good catch!
from cmv-widgets.
Hi, roemhildtg:
Thanks a lot for your help.
Now i moved forward one step, but got a new problem,
it seems the url is too long, but also when i test the url, (it is
something like this
when i test it, i got
HTTP Error 400. The request URL is invalid.
Please see if you know the issue in this regard.
Thank you again so much for your help.
On Sat, May 9, 2015 at 2:39 PM, roemhildtg [email protected] wrote:
I just found the bug. I wasn't having any issues, but after pasting the
config from the documentation, I experienced the same issue. There was a
typo in the documentation config, in the option for emailSettings,
savelayerVisibility should be changed to save_L_ayerVisibility
emailSettings: ['saveMapExtent', 'saveLayerVisibility'],Good catch!
—
Reply to this email directly or view it on GitHub
#9 (comment)
.
from cmv-widgets.
I ran into this issue as well, we are using this widget to save drawings which end up to be 20,000 characters or more... I ended up writing two php scripts to store and retrieve the saved map in a sqlite database. To use it, place the php script on your server somewhere, and then send the option server: 'path/to/index.php'
to appSettings.
Note: you have to have php installed and enabled on your server for this.
from cmv-widgets.
Thanks a lot. Got the php/sqlite in place, and the link is working. I will
do more test this coming week.
One thing i noticed is if I clear the google chrome history data, then it
seems to me it also deletes the sqlite DB content? i am not very sure about
that, but will do more test.
Another thing is the php page does need write permission in the web server
folder, is there anyway we can control that or change that?
Anyway that is a wonder approach, thank you very much!
Long
On Sun, May 10, 2015 at 9:36 AM, roemhildtg [email protected]
wrote:
I ran into this issue as well. I ended up writing two php scripts
https://github.com/roemhildtg/CMV_Widgets/blob/master/widgets/AppSettings/php/index.php
to store and retrieve the saved map in a sqlite database. To use it, place
the php script on your server somewhere, and then send the option server:
'path/to/index.php' to appSettings.—
Reply to this email directly or view it on GitHub
#9 (comment)
.
from cmv-widgets.
Hi, @roemhildtg
It works beautifully in my test environment.
The only thing or enhancement I would like to have if you could is to store
the basemap info in the configure setting. Please let me know if that is in
this version or it is something for future enhancement.
Thanks again.
On Sun, May 10, 2015 at 9:09 PM, Long Ma [email protected] wrote:
Thanks a lot. Got the php/sqlite in place, and the link is working. I will
do more test this coming week.One thing i noticed is if I clear the google chrome history data, then it
seems to me it also deletes the sqlite DB content? i am not very sure about
that, but will do more test.Another thing is the php page does need write permission in the web server
folder, is there anyway we can control that or change that?Anyway that is a wonder approach, thank you very much!
Long
On Sun, May 10, 2015 at 9:36 AM, roemhildtg [email protected]
wrote:I ran into this issue as well. I ended up writing two php scripts
https://github.com/roemhildtg/CMV_Widgets/blob/master/widgets/AppSettings/php/index.php
to store and retrieve the saved map in a sqlite database. To use it, place
the php script on your server somewhere, and then send the option server:
'path/to/index.php' to appSettings.—
Reply to this email directly or view it on GitHub
#9 (comment)
.
from cmv-widgets.
It's not in this version ootb, but it is easily doable. Just modify the basemap widget to store and retrieve the settings using dojo/topic
. See the details here
We did it like this:
define([
'dojo/_base/declare',
'dijit/_WidgetBase',
'dijit/_TemplatedMixin',
'dijit/_WidgetsInTemplateMixin',
'dojo/_base/lang',
'dijit/DropDownMenu',
'dijit/MenuItem',
'dojo/_base/array',
'dojox/lang/functional',
'dojo/text!./Basemaps/templates/Basemaps.html',
'esri/dijit/BasemapGallery',
'dojo/topic',
'dojo/i18n!./Basemaps/nls/resource',
'dijit/form/DropDownButton',
'xstyle/css!./Basemaps/css/Basemaps.css'
], function (declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, lang, DropDownMenu, MenuItem, array, functional, template, BasemapGallery, topic, i18n) {
// main basemap widget
return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], {
templateString: template,
widgetsInTemplate: true,
i18n: i18n,
mode: 'agol',
title: i18n.title,
//baseClass: 'gis_Basemaps_Dijit',
//buttonClass: 'gis_Basemaps_Button',
//menuClass: 'gis_Basemaps_Menu',
mapStartBasemap: 'streets',
basemapsToShow: ['streets', 'satellite', 'hybrid', 'topo', 'gray', 'oceans', 'national-geographic', 'osm'],
validBasemaps: [],
selectedIcon: 'fa fa-fw fa-check-square-o',
emptyIcon: 'fa fa-fw fa-square-o',
postCreate: function () {
this.inherited(arguments);
//this.currentBasemap = this.mapStartBasemap || null;
if (this.mode === 'custom') {
this.gallery = new BasemapGallery({
map: this.map,
showArcGISBasemaps: false,
basemaps: functional.map(this.basemaps, function (map) {
return map.basemap;
})
});
// if (this.map.getBasemap() !== this.mapStartBasemap) { //based off the title of custom basemaps in viewer.js config
// this.gallery.select(this.mapStartBasemap);
// }
this.gallery.startup();
}
this.menu = new DropDownMenu({
style: 'display: none;' //,
//baseClass: this.menuClass
});
array.forEach(this.basemapsToShow, function (basemap) {
if (this.basemaps.hasOwnProperty(basemap)) {
var menuItem = new MenuItem({
id: basemap,
label: this.basemaps[basemap].title,
iconClass: 'fa fa-fw ' + this.emptyIcon,
onClick: lang.hitch(this, function () {
if (basemap !== this.currentBasemap) {
/* save the current basemap value */
topic.publish('AppSettings/setValue', 'saveBasemap', {
value: basemap
});
topic.publish('googleAnalytics/events', {
category: 'Basemap',
action: 'basemap-change',
label: basemap
});
this.setBasemap(basemap);
}
})
});
this.menu.addChild(menuItem);
}
}, this);
this.dropDownButton.set('dropDown', this.menu);
/* load the saved basemap value */
topic.subscribe('AppSettings/onSettingsLoad', lang.hitch(this, '_loadBasemapFromSettings'));
},
setBasemap: function (basemap) {
if (this.currentBasemap !== basemap) {
this.currentBasemap = basemap;
if (this.mode === 'custom') {
this.gallery.select(basemap);
} else {
this.map.setBasemap(basemap);
}
var ch = this.menu.getChildren();
array.forEach(ch, lang.hitch(this, function (c) {
if (c.id === basemap) {
c.set('iconClass', this.selectedIcon);
} else {
c.set('iconClass', this.emptyIcon);
}
}));
}
},
startup: function () {
this.inherited(arguments);
this.setBasemap(this.mapStartBasemap);
},
_loadBasemapFromSettings: function (settings) {
if (settings && settings.saveBasemap &&
settings.saveBasemap.value &&
(settings.saveBasemap.save || settings.saveBasemap.urlLoad)) {
this.setBasemap(settings.saveBasemap.value);
}
}
});
});
from cmv-widgets.
I'm also working on making the widget easier to use with mixins, and I've started on that but I've got a little more work to do. I'll probably push that out tomorrow, then a mixin could be created to add the basemap settings into the widget.
from cmv-widgets.
Hi, Gregg:
Thank you so much, got it working now.
Added this in the config part
//optional (defaults shown):
appSettings: {
saveBasemap: {
save: false,
value: {},
checkbox: true,
label: 'Save Basemap',
urlLoad: false
}
},
emailSettings: ['saveMapExtent',
'saveLayerVisibility', 'saveBasemap'],
everything works wonderfully!!
Thanks again.
Long
On Mon, May 11, 2015 at 4:00 PM, Gregg Roemhildt [email protected]
wrote:
I'm also working on making the widget easier to use with mixins, and I've
started on that but I've got a little more work to do. I'll probably push
that out tomorrow, then a mixin could be created to add the basemap
settings into the widget.—
Reply to this email directly or view it on GitHub
#9 (comment)
.
from cmv-widgets.
Just a small warning on the php script, it's not sanitizing any of the input so be wary of placing it on a public facing server. Someone could easily post something like 'DROP * FROM Data WHERE 1=1;'
..in addition to sql commands, there may be other security flaws.
from cmv-widgets.
Ok, I am aware of that, it should not be that critical, the lost maybe just
the saved map settings.
Thanks.
On Mon, May 11, 2015 at 8:11 PM, Gregg Roemhildt [email protected]
wrote:
Just a small warning on the php script, it's not sanitizing any of the
input so be wary of placing it on a public facing server. Someone could
easily post something like 'DROP * FROM Data WHERE 1=1;'..in addition to
sql commands, there may be other security flaws.—
Reply to this email directly or view it on GitHub
#9 (comment)
.
from cmv-widgets.
Related Issues (20)
- AppSetting widget in CMV develop version HOT 13
- use mediaInfos with relationshiptable values HOT 12
- Can it be used on a featureService? HOT 7
- Related Record issue maybe HOT 6
- Troubleshooting label widget HOT 6
- Filter widget config file HOT 10
- Relateion table does not work for dynamic layers HOT 11
- Problem with labellayer HOT 2
- Reset timeslider on close HOT 2
- limited space of relationtable in identify HOT 3
- Demo branch not available HOT 1
- problem with appsetting widget HOT 1
- basemap in appsetting HOT 6
- Label Widget field list gets appended to HOT 2
- App Settings load if not "open" HOT 1
- AppSettings Widget just opens a new map HOT 2
- Heatmap for the Filtered features HOT 4
- Limit features available to filter widget HOT 1
- Deactivate time slider when time-aware-layers is not visible on the Map
- Relationship Attachments HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cmv-widgets.