Comments (6)
Doubt we will have that prioritization/resources for this older codebase.
RAMP4 spits out a "package" build, I will add a discussion item for us to look into putting it on npm
from fgpv-vpgf.
It seems like the map is is being drawn while calculation for visibility
is still happening (removing the function, the map loads in all browsers with no issues). The function that calculates layer visibility looks as follows:
function isLayerVisible(layerId: string) {
if (localStorage.getItem("selectedLayers") != null) {
let savedLayers = localStorage.getItem("selectedLayers")!.split(",");
return savedLayers.includes(layerId);
}
}
The config is as follows using isLayerVisible
function
Line: "visibility": ` + isLayerVisible("fire_m3_hotspots") + `:
{
"layerChoice": "file",
"layerType": "esriFeature",
"fileType": "geojson",
"colour": "#E633FF",
"tolerance": 5,
"outfields": "*",
"controls": [
"opacity",
"visibility",
"boundingBox",
"query",
"snapshot",
"metadata",
"boundaryZoom",
"refresh",
"reload",
"remove",
"settings",
"data",
"styles"
],
"disabledControls": [],
"enableStructuredDelete": false,
"state": {
"opacity": 0.5,
"visibility": ` +
isLayerVisible("fire_m3_hotspots") +
`,
"boundingBox": false,
"query": true,
"snapshot": false,
"hovertips": true
},
"table": {
"title": "",
"maximize": false,
"lazyFilter": false,
"applyMap": false,
"showFilter": true,
"filterByExtent": false,
"searchStrictMatch": false,
"printEnabled": false,
"columns": []
},
"name": "Fire M3 Hotspots",
"id": "fire_m3_hotspots",
"customRenderer": {
"type": "classBreaks",
"field" : "age",
"minValue": 0,
"classBreakInfos": [
{
"minValue": 0,
"classMaxValue": 6,
"label": "0 - 6 hours",
"symbol": {
"type": "esriSMS",
"style": "esriSMSCircle",
"color": [255, 0, 0],
"size": 8,
"angle": 0,
"xoffset": 0,
"yoffset": 0,
"outline": {
"color": [255, 0, 0],
"width": 1
}
}
},
{
"minValue": 6,
"classMaxValue": 12,
"label": "6 - 12 hours",
"symbol": {
"type": "esriSMS",
"style": "esriSMSCircle",
"color": [255, 175, 0],
"size": 8,
"angle": 0,
"xoffset": 0,
"yoffset": 0,
"outline": {
"color": [255, 175, 0],
"width": 1
}
}
},
{
"minValue": 12,
"classMaxValue": 24,
"label": "12 - 24 hours",
"symbol": {
"type": "esriSMS",
"style": "esriSMSCircle",
"color": [255, 255, 0],
"size": 8,
"angle": 0,
"xoffset": 0,
"yoffset": 0,
"outline": {
"color": [255, 255, 0],
"width": 1
}
}
}
]
},
"url": "https://cwfis.cfs.nrcan.gc.ca/geoserver/public/ows?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&typeName=public%3Ahotspots_last24hrs&outputFormat=application%2Fjson"
}
Above JSON is then passed to data-rv-config
as data-rv-config={configValue}
from fgpv-vpgf.
Instead of using a div that takes data-rv-config
, perhaps you could try this approach
https://fgpv-vpgf.github.io/fgpv-vpgf/develop/docs/#/mapauthor/intro?id=_2-api
Run your custom code that generates your desired config file, then use the RAMP.Map(<mydiv>, <myconfig>)
to create the map when you are ready.
I rarely use this so hoping it still works / does what you need.
from fgpv-vpgf.
I noticed that this takes a file as an argument though. This means that the file is static whereas in my case I am modifying a variable before it is passed to the map id
from fgpv-vpgf.
The source suggests it will accept a JSON object as well.
This line indicates the object needs to have the "version"
property set, but thats all the check is really validating.
So try if you feel like it. Hope it works. Actually maybe try with and without the version
. That IF statement is funnylookin' and I didn't write it, so maybe one path will do what you're trying to do.
from fgpv-vpgf.
Has the RAMP team discussed making RAMP
an npm
package for people using React
or Angular
.
from fgpv-vpgf.
Related Issues (20)
- Feature Layer Initial Filter is not working
- Documentation: broken links for samples, sample configs HOT 2
- User selections HOT 4
- map layer checkbox event HOT 7
- Basemap accepted endpoints HOT 9
- layers showing as radio button instead of checkboxes in grouped layers HOT 1
- WCAG: Implement alt tags in Help documents HOT 4
- Remove HTTP URL trickery HOT 1
- RAMP load times HOT 15
- RAMP adding/removing scripts to the html document HOT 5
- Update file-saver HOT 1
- Demo Build process is broken HOT 1
- Reporting a vulnerability HOT 1
- Symbol failures when default symbol has no label HOT 1
- Services with reordered indexes fail
- The datatable causes infinite queries for map service having Data operation disabled HOT 1
- Fullscreen service bug with multiple ramps
- Grid accessibility on Storylines
- Pygeoapi update breaking WFS functionality
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 fgpv-vpgf.