-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
only got the map extent, but the layer is always off when i use the share widget. #9
Comments
@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? |
Hi, @roemhildtg: My site is still in our internal server, so i cannot share it. but here is the config settings:
icon-paper-clip"> Save/Share Current Map',
fa-envelope-o">Share Map', Yes, I download the latest widget from the github yesterday. Thanks a lot, Long On Thu, May 7, 2015 at 6:53 AM, roemhildtg notifications@github.com wrote:
|
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. |
Hi, Thanks a lot. Here is the layer config portion.
https://gis.eparm.net/eparmgis/rest/services/R6Secure/RMP_PDO/MapServer', On Thu, May 7, 2015 at 9:30 PM, roemhildtg notifications@github.com 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 saveLayerVisibility Good catch! |
Hi, roemhildtg: Thanks a lot for your help. it seems the url is too long, but also when i test the url, (it is 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 notifications@github.com wrote:
|
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 Note: you have to have php installed and enabled on your server for this. |
Thanks a lot. Got the php/sqlite in place, and the link is working. I will One thing i noticed is if I clear the google chrome history data, then it Another thing is the php page does need write permission in the web server Anyway that is a wonder approach, thank you very much! Long On Sun, May 10, 2015 at 9:36 AM, roemhildtg notifications@github.com
|
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 Thanks again. On Sun, May 10, 2015 at 9:09 PM, Long Ma long.d.ma@gmail.com wrote:
|
It's not in this version ootb, but it is easily doable. Just modify the basemap widget to store and retrieve the settings using 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);
}
}
});
}); |
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. |
Hi, Gregg: Thank you so much, got it working now. Added this in the config part
'saveLayerVisibility', 'saveBasemap'], everything works wonderfully!! Thanks again. Long On Mon, May 11, 2015 at 4:00 PM, Gregg Roemhildt notifications@github.com
|
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 |
Ok, I am aware of that, it should not be that critical, the lost maybe just Thanks. On Mon, May 11, 2015 at 8:11 PM, Gregg Roemhildt notifications@github.com
|
Please let me know what i miss.
Thanks a lot.
Long
The text was updated successfully, but these errors were encountered: