-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2e43d64
commit 63e40c1
Showing
191 changed files
with
8,687 additions
and
324 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
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
File renamed without changes.
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
2 changes: 1 addition & 1 deletion
2
...emos/Map/ProvidersAndTypes/React/index.js → JSDemos/Demos/Map/Markers/React/index.tsx
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,61 @@ | ||
import React from 'react'; | ||
import Map from 'devextreme-react/map'; | ||
import Button from 'devextreme-react/button'; | ||
import CheckBox from 'devextreme-react/check-box'; | ||
import { markersData } from './data.js'; | ||
|
||
const markerUrl = 'https://js.devexpress.com/Demos/WidgetsGallery/JSDemos/images/maps/map-marker.png'; | ||
const apiKey = { | ||
bing: 'Aq3LKP2BOmzWY47TZoT1YdieypN_rB6RY9FqBfx-MDCKjvvWBbT68R51xwbL-AqC', | ||
}; | ||
const App = () => { | ||
const [currentMarkersData, setCurrentMarkersData] = React.useState(markersData); | ||
const [currentMarkerUrl, setCurrentMarkerUrl] = React.useState(markerUrl); | ||
const onCustomMarkersChange = React.useCallback( | ||
(value) => { | ||
setCurrentMarkerUrl(value ? currentMarkerUrl : null); | ||
setCurrentMarkersData(markersData); | ||
}, | ||
[currentMarkerUrl, setCurrentMarkerUrl, setCurrentMarkersData], | ||
); | ||
const showTooltips = React.useCallback(() => { | ||
setCurrentMarkersData( | ||
currentMarkersData.map((item) => { | ||
const newItem = JSON.parse(JSON.stringify(item)); | ||
newItem.tooltip.isShown = true; | ||
return newItem; | ||
}), | ||
); | ||
}, [currentMarkersData, setCurrentMarkersData]); | ||
return ( | ||
<React.Fragment> | ||
<Map | ||
defaultZoom={11} | ||
height={440} | ||
width="100%" | ||
controls={true} | ||
markerIconSrc={currentMarkerUrl} | ||
markers={currentMarkersData} | ||
provider="bing" | ||
apiKey={apiKey} | ||
></Map> | ||
<div className="options"> | ||
<div className="caption">Options</div> | ||
<div className="option"> | ||
<CheckBox | ||
defaultValue={true} | ||
text="Use custom marker icons" | ||
onValueChange={onCustomMarkersChange} | ||
/> | ||
</div> | ||
<div className="option"> | ||
<Button | ||
text="Show all tooltips" | ||
onClick={showTooltips} | ||
/> | ||
</div> | ||
</div> | ||
</React.Fragment> | ||
); | ||
}; | ||
export default App; |
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,26 @@ | ||
export const markersData = [ | ||
{ | ||
location: [40.755833, -73.986389], | ||
tooltip: { | ||
text: 'Times Square', | ||
}, | ||
}, | ||
{ | ||
location: '40.7825, -73.966111', | ||
tooltip: { | ||
text: 'Central Park', | ||
}, | ||
}, | ||
{ | ||
location: { lat: 40.753889, lng: -73.981389 }, | ||
tooltip: { | ||
text: 'Fifth Avenue', | ||
}, | ||
}, | ||
{ | ||
location: 'Brooklyn Bridge,New York,NY', | ||
tooltip: { | ||
text: 'Brooklyn Bridge', | ||
}, | ||
}, | ||
]; |
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,44 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>DevExtreme Demo</title> | ||
<meta | ||
http-equiv="X-UA-Compatible" | ||
content="IE=edge" | ||
/> | ||
<meta | ||
http-equiv="Content-Type" | ||
content="text/html; charset=utf-8" | ||
/> | ||
<meta | ||
name="viewport" | ||
content="width=device-width, initial-scale=1.0, maximum-scale=1.0" | ||
/> | ||
<link | ||
rel="stylesheet" | ||
type="text/css" | ||
href="../../../../../node_modules/devextreme-dist/css/dx.light.css" | ||
/> | ||
<link | ||
rel="stylesheet" | ||
type="text/css" | ||
href="styles.css" | ||
/> | ||
|
||
<script src="../../../../../node_modules/core-js/client/shim.min.js"></script> | ||
<script src="../../../../../node_modules/systemjs/dist/system.js"></script> | ||
<script | ||
type="text/javascript" | ||
src="config.js" | ||
></script> | ||
<script type="text/javascript"> | ||
System.import("./index.js"); | ||
</script> | ||
</head> | ||
|
||
<body class="dx-viewport"> | ||
<div class="demo-container"> | ||
<div id="app"></div> | ||
</div> | ||
</body> | ||
</html> |
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,5 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import App from './App.js'; | ||
|
||
ReactDOM.render(<App />, document.getElementById('app')); |
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,14 @@ | ||
.options { | ||
padding: 20px; | ||
background-color: rgba(191, 191, 191, 0.15); | ||
margin-top: 20px; | ||
} | ||
|
||
.caption { | ||
font-size: 18px; | ||
font-weight: 500; | ||
} | ||
|
||
.option { | ||
margin-top: 10px; | ||
} |
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
4 changes: 3 additions & 1 deletion
4
...Demos/Map/ProvidersAndTypes/React/data.js → ...Demos/Map/ProvidersAndTypes/React/data.ts
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
2 changes: 1 addition & 1 deletion
2
JSDemos/Demos/Map/Markers/React/index.js → ...mos/Map/ProvidersAndTypes/React/index.tsx
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,45 @@ | ||
import React from 'react'; | ||
import Map from 'devextreme-react/map'; | ||
import SelectBox from 'devextreme-react/select-box'; | ||
import { mapTypes, mapTypeLabel } from './data.js'; | ||
|
||
const apiKey = { | ||
bing: 'Aq3LKP2BOmzWY47TZoT1YdieypN_rB6RY9FqBfx-MDCKjvvWBbT68R51xwbL-AqC', | ||
}; | ||
const App = () => { | ||
const [mapTypeValue, setMapTypeValue] = React.useState(mapTypes[0].key); | ||
const onMapTypeChange = React.useCallback( | ||
(value) => { | ||
setMapTypeValue(value); | ||
}, | ||
[setMapTypeValue], | ||
); | ||
return ( | ||
<div> | ||
<Map | ||
defaultCenter="40.7061, -73.9969" | ||
defaultZoom={14} | ||
height={400} | ||
width="100%" | ||
provider="bing" | ||
type={mapTypeValue} | ||
apiKey={apiKey} | ||
></Map> | ||
<div className="options"> | ||
<div className="caption">Options</div> | ||
<div className="option"> | ||
<span>Map Type</span> | ||
<SelectBox | ||
value={mapTypeValue} | ||
onValueChange={onMapTypeChange} | ||
dataSource={mapTypes} | ||
inputAttr={mapTypeLabel} | ||
displayExpr="name" | ||
valueExpr="key" | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
export default App; |
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,15 @@ | ||
export const mapTypes = [ | ||
{ | ||
key: 'roadmap', | ||
name: 'Road Map', | ||
}, | ||
{ | ||
key: 'satellite', | ||
name: 'Satellite (Photographic) Map', | ||
}, | ||
{ | ||
key: 'hybrid', | ||
name: 'Hybrid Map', | ||
}, | ||
]; | ||
export const mapTypeLabel = { 'aria-label': 'Map Type' }; |
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,44 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>DevExtreme Demo</title> | ||
<meta | ||
http-equiv="X-UA-Compatible" | ||
content="IE=edge" | ||
/> | ||
<meta | ||
http-equiv="Content-Type" | ||
content="text/html; charset=utf-8" | ||
/> | ||
<meta | ||
name="viewport" | ||
content="width=device-width, initial-scale=1.0, maximum-scale=1.0" | ||
/> | ||
<link | ||
rel="stylesheet" | ||
type="text/css" | ||
href="../../../../../node_modules/devextreme-dist/css/dx.light.css" | ||
/> | ||
<link | ||
rel="stylesheet" | ||
type="text/css" | ||
href="styles.css" | ||
/> | ||
|
||
<script src="../../../../../node_modules/core-js/client/shim.min.js"></script> | ||
<script src="../../../../../node_modules/systemjs/dist/system.js"></script> | ||
<script | ||
type="text/javascript" | ||
src="config.js" | ||
></script> | ||
<script type="text/javascript"> | ||
System.import("./index.js"); | ||
</script> | ||
</head> | ||
|
||
<body class="dx-viewport"> | ||
<div class="demo-container"> | ||
<div id="app"></div> | ||
</div> | ||
</body> | ||
</html> |
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,5 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import App from './App.js'; | ||
|
||
ReactDOM.render(<App />, document.getElementById('app')); |
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,28 @@ | ||
.options { | ||
padding: 20px; | ||
background-color: rgba(191, 191, 191, 0.15); | ||
margin-top: 20px; | ||
} | ||
|
||
.caption { | ||
font-size: 18px; | ||
font-weight: 500; | ||
} | ||
|
||
.option { | ||
margin-top: 10px; | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.option > span { | ||
display: inline-block; | ||
width: 100px; | ||
} | ||
|
||
.option > .dx-selectbox { | ||
width: 100%; | ||
max-width: 350px; | ||
display: inline-block; | ||
vertical-align: middle; | ||
} |
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.