Skip to content

Commit

Permalink
docs: update broken link (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
behoney authored Oct 5, 2024
2 parents 56e73ca + b79426a commit 3c79e96
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { defineConfig } from "astro/config";
export default defineConfig({
integrations: [react()],
site: "https://behoney.github.io",
base: process.env.NODE_ENV === "production" ? "/react-geojson-map" : "/",
base: process.env.NODE_ENV === "production" ? "/react-geojson-map/" : "/",
vite: {
watch: {
include: ["./**"],
Expand Down
1 change: 1 addition & 0 deletions docs/public/hello-world.geojson
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"type":"FeatureCollection","features":[{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[-103.35937499999999,66.93006025862448],[-104.4140625,39.90973623453719],[-94.21875,39.36827914916011],[-93.8671875,50.28933925329178],[-85.78125,50.28933925329178],[-85.78125,39.639537564366684],[-75.5859375,39.639537564366684],[-77.6953125,67.06743335108298],[-86.484375,66.79190947341796],[-85.78125,57.7041472343419],[-92.8125,57.32652122521709],[-94.21875,66.51326044311188],[-103.35937499999999,66.93006025862448]]]}},{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[-71.3671875,67.47492238478702],[-40.42968749999999,67.60922060496382],[-40.78125,64.01449619484472],[-61.52343749999999,63.548552232036414],[-61.52343749999999,57.89149735271031],[-50.625,57.89149735271031],[-50.625,51.39920565355378],[-60.1171875,51.39920565355378],[-61.17187499999999,42.032974332441405],[-42.1875,42.293564192170095],[-42.1875,36.87962060502676],[-68.203125,34.88593094075317],[-71.3671875,67.47492238478702]]]}},{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[-32.6953125,67.60922060496382],[-32.34375,39.36827914916011],[-4.21875,40.713955826286046],[-4.21875,47.754097979680026],[-20.7421875,47.040182144806664],[-21.796875,67.87554134672945],[-32.6953125,67.60922060496382]]]}},{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[4.5703125,68.78414378041504],[5.9765625,42.553080288955826],[37.265625,43.83452678223682],[37.265625,49.61070993807422],[18.6328125,50.28933925329178],[15.468749999999998,69.03714171275197],[4.5703125,68.78414378041504]]]}},{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[41.8359375,43.068887774169625],[41.8359375,68.65655498475735],[95.625,68.65655498475735],[95.625,43.068887774169625],[41.8359375,43.068887774169625]]]}},{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[50.9765625,47.27922900257082],[50.9765625,66.93006025862448],[89.296875,66.93006025862448],[89.296875,47.27922900257082],[50.9765625,47.27922900257082]]]}},{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[-115.6640625,18.312810846425442],[-98.7890625,18.979025953255267],[-84.72656249999999,-15.961329081596634],[-75.5859375,-4.565473550710278],[-69.2578125,-4.214943141390639],[-65.7421875,-15.284185114076433],[-53.0859375,19.973348786110602],[-39.7265625,21.28937435586041],[-65.0390625,-41.244772343082076],[-73.828125,-42.0329743324414],[-76.640625,-28.613459424004414],[-84.375,-41.50857729743933],[-94.921875,-42.0329743324414],[-115.6640625,18.312810846425442]]]}},{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[-34.80468749999999,-39.09596293630548],[-34.80468749999999,21.28937435586041],[14.414062499999998,21.28937435586041],[14.414062499999998,-39.09596293630548],[-34.80468749999999,-39.09596293630548]]]}},{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[-28.125,-31.05293398570514],[-28.125,14.944784875088372],[8.7890625,14.944784875088372],[8.7890625,-31.05293398570514],[-28.125,-31.05293398570514]]]}},{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[23.203125,21.616579336740603],[22.148437499999996,-38.27268853598096],[32.34375,-37.99616267972812],[33.75,-15.961329081596634],[45.3515625,-36.597889133070204],[59.765625,-36.03133177633187],[39.0234375,-5.266007882805485],[54.84375,-3.513421045640032],[53.0859375,23.241346102386135],[23.203125,21.616579336740603]]]}},{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[28.828124999999996,2.811371193331128],[28.828124999999996,16.972741019999035],[46.7578125,16.972741019999035],[46.7578125,2.811371193331128],[28.828124999999996,2.811371193331128]]]}},{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[65.0390625,22.917922936146045],[66.09375,-34.30714385628803],[111.4453125,-34.30714385628803],[110.390625,-25.79989118208832],[78.3984375,-24.206889622398023],[76.9921875,23.56398712845123],[65.0390625,22.917922936146045]]]}},{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[117.0703125,25.165173368663954],[121.640625,-33.13755119234615],[135.35156249999997,-31.653381399663985],[146.25,-20.3034175184893],[148.7109375,-9.79567758282973],[148.359375,0],[145.1953125,7.36246686553575],[140.2734375,14.604847155053898],[135.703125,20.632784250388028],[128.671875,24.206889622398023],[121.9921875,26.11598592533351],[117.0703125,25.165173368663954]]]}}]}
14 changes: 14 additions & 0 deletions docs/src/examples/HelloWorldExample.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from "react";
import { GeoDataSource, GeoMap } from "../../../src/lib";

const HelloWorldExample: React.FC = () => {
return (
<div style={{ width: "300px", height: "300px" }}>
<GeoMap>
<GeoDataSource fitViewToData={true} url="hello-world.geojson" />
</GeoMap>
</div>
);
};

export default HelloWorldExample;
2 changes: 1 addition & 1 deletion docs/src/layouts/ExampleLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const { title } = Astro.props;
<slot />
</main>
<nav>
<a href="/examples">Back to examples</a>
<a href={`${import.meta.env.BASE_URL}examples`}>Back to examples</a>
</nav>

<style>
Expand Down
6 changes: 3 additions & 3 deletions docs/src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import DefaultMapExample from '../examples/DefaultMapExample';
import HelloWorldExample from '../examples/HelloWorldExample';
import Layout from '../layouts/Layout.astro';
---

Expand Down Expand Up @@ -27,15 +27,15 @@ function App() {
return (
<div style="width: 300px; height: 300px;">
<GeoMap>
<GeoDataSource url="sample.geojson" />
<GeoDataSource url="hello-world.geojson" />
</GeoMap>
</div>
);
}
`}
</code>
</pre>
<DefaultMapExample client:only="react" aria-label="Map example" />
<HelloWorldExample client:only="react" aria-label="Map example" />
</div>
<p>Try it live on <a href="https://shorturl.at/7XuDN" target="_blank" rel="noopener noreferrer">StackBlitz</a></p>

Expand Down

0 comments on commit 3c79e96

Please sign in to comment.