-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Domain request headers and bug fixes (#63)
* added customizable domain headers to stylesheet resources * fixed localStorage existing data bug - closes #62 * updated README
- Loading branch information
1 parent
9b5ced6
commit 86a41e3
Showing
18 changed files
with
448 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,42 @@ | ||
# fresco | ||
An open source vector map style editor utilizing Mapbox GL. | ||
|
||
[Try it](https://fresco.netlify.com/) | ||
Fresco is an open source [Mapbox Vector Tile Style](https://docs.mapbox.com/mapbox-gl-js/style-spec) editor that allows cartographers to craft stylesheets for use with [Mapbox GL](https://docs.mapbox.com/mapbox-gl-js/api/) maps. Unlike other style editors, Fresco does not attempt to hide the complexity of Mapbox GL Styles but rather exposes an interactive JSON code editor to allow for maximum control and flexibility. This allows the user to implement more complex styles concepts like data driven styles with [expressions](https://docs.mapbox.com/help/tutorials/mapbox-gl-js-expressions/). When using Fresco, it may be helpful to have the [Mapbox Style Spec](https://docs.mapbox.com/mapbox-gl-js/style-spec/) available as a reference. | ||
|
||
Styles created and modified with Fresco are saved to the browser's local storage and are auto-saved on changes. | ||
|
||
Give it a try: [https://fresco.gospatial.org/](https://fresco.gospatial.org/) | ||
|
||
![map editing screen shot](/docs/img/osm-screenshot.png) | ||
|
||
## Features | ||
|
||
- Style editor for Mapbox-gl styles | ||
- Styles stored in localStorage (in the browser) | ||
- JSON editor | ||
- Layer property editor | ||
- MapboxGL expression support | ||
- Interactive JSON code editor. | ||
- Style editor for Mapbox GL styles. | ||
- Mapbox GL layer style expression editor. | ||
- Auto save on changes. | ||
- Styles persisted to local storage (in the browser). | ||
- Mapbox GL style error parser. Displays the error at the error location in the style. | ||
- Integrated Mapbox GL style spec attributes (info on style fields). | ||
- Custom domain header configurations. Useful for domains which require `Authorization` headers. | ||
|
||
## Usage | ||
|
||
## Installation | ||
Fresco may be used in the browser by visiting [https://fresco.gospatial.org/](https://fresco.gospatial.org/) or by downloading a pre compiled binary from the [releases](https://github.com/go-spatial/fresco/releases) page. | ||
|
||
## Running from source | ||
|
||
Fresco is built on top of React. To run Freco from source use the following steps: | ||
|
||
1. Download the latest version of [Node.js](https://nodejs.org/en/download/) | ||
2. Clone this repository to your computer | ||
3. Navigate to this repo on your computer | ||
4. Run `npm install` | ||
5. To startup, run `npm start` - Fresco should open in a browser window | ||
|
||
![map editing screenshot](/docs/img/osm-screenshot.png) | ||
## Contributing | ||
|
||
Contributions are welcome! Fork the repo and send in a PR with any bug fixes or features. | ||
|
||
## Looking for a vector tile server? | ||
|
||
If you're looking to create vector tiles that can be styled with Fresco, check out [tegola](https://github.com/go-spatial/tegola)! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import {applyMiddleware} from 'redux'; | ||
import logger from 'redux-logger'; | ||
//import logger from 'redux-logger'; | ||
import thunk from 'redux-thunk'; | ||
|
||
import error from './error'; | ||
|
||
export default applyMiddleware(logger,error,thunk); | ||
export default applyMiddleware(/*logger,*/error,thunk); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const getDomain = (url)=>{ | ||
if (!url) return null | ||
var matches = url.match(/^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i); | ||
var domain = matches && matches[1]; | ||
return domain || null | ||
} | ||
|
||
module.exports = { | ||
getDomain | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.