map + routing
This commit is contained in:
@@ -1,16 +1,25 @@
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import MapView from "@arcgis/core/views/MapView";
|
||||
import Map from "@arcgis/core/Map";
|
||||
|
||||
// import { createMapView } from "../../ArcGIS-SDK";
|
||||
|
||||
const createMapView = (container: HTMLDivElement) => {
|
||||
// const map = new Map({
|
||||
// // extent:esri.geometry.geographicToWebMercator(initExtent),
|
||||
// slider:false
|
||||
// });
|
||||
const map = new Map({
|
||||
basemap: "osm",
|
||||
// basemap: "osm",
|
||||
basemap: "streets",
|
||||
// ground: "world-elevation",
|
||||
// basemap: "terrain/base",
|
||||
});
|
||||
|
||||
return new MapView({
|
||||
map: map,
|
||||
container: container,
|
||||
center: [55, 25],
|
||||
center: [54.67, 24.33],
|
||||
zoom: 13,
|
||||
});
|
||||
};
|
||||
@@ -38,7 +47,7 @@ export const MapComponent = (props: IArcMapViewProps) => {
|
||||
return () => _view && _view.destroy();
|
||||
}, []);
|
||||
return (
|
||||
<div className="w-80 h-80" ref={mapRef}>
|
||||
<div className="w-screen h-screen" ref={mapRef}>
|
||||
<MapViewContext.Provider value={{ view }}>
|
||||
{children}
|
||||
</MapViewContext.Provider>
|
||||
|
||||
Reference in New Issue
Block a user