mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-28 16:31:16 +01:00
Merge pull request #166 from orangemug/feature/load-from-url
Added 'Load from URL' option in open modal
This commit is contained in:
commit
e1f7336aa9
1 changed files with 17 additions and 0 deletions
|
@ -75,6 +75,11 @@ class OpenModal extends React.Component {
|
|||
})
|
||||
}
|
||||
|
||||
onOpenUrl() {
|
||||
const url = this.refs.styleUrl.value;
|
||||
this.onStyleSelect(url);
|
||||
}
|
||||
|
||||
onUpload(_, files) {
|
||||
const [e, file] = files[0];
|
||||
const reader = new FileReader();
|
||||
|
@ -139,6 +144,18 @@ class OpenModal extends React.Component {
|
|||
<Button className="maputnik-upload-button"><FileUploadIcon /> Upload</Button>
|
||||
</FileReaderInput>
|
||||
</section>
|
||||
|
||||
<section className="maputnik-modal-section">
|
||||
<h2>Load from URL</h2>
|
||||
<p>
|
||||
Load from a URL. Note that the URL must have <a href="https://enable-cors.org" target="_blank" rel="noopener noreferrer">CORS enabled</a>.
|
||||
</p>
|
||||
<input type="text" ref="styleUrl" className="maputnik-input" placeholder="Enter URL..."/>
|
||||
<div>
|
||||
<Button className="maputnik-big-button" onClick={this.onOpenUrl.bind(this)}>Open URL</Button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section className="maputnik-modal-section maputnik-modal-section--shrink">
|
||||
<h2>Gallery Styles</h2>
|
||||
<p>
|
||||
|
|
Loading…
Reference in a new issue