Skip to content

Commit 4a9004c

Browse files
committed
Explain markers
1 parent 02728a4 commit 4a9004c

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

src/Fable.ReactGoogleMaps/Fable.ReactGoogleMaps.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
4-
<Version>0.2.1</Version>
4+
<Version>0.2.2</Version>
55
<TargetFramework>netstandard2.0</TargetFramework>
66
<GenerateDocumentationFile>true</GenerateDocumentationFile>
77
</PropertyGroup>

src/Fable.ReactGoogleMaps/README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,28 @@ and in your F# code you can create the map like this:
2626
let myMap =
2727
googleMap [
2828
MapProperties.ApiKey googleMapApiKey
29-
MapProperties.MapContainer "mapContainer"
29+
MapProperties.MapLoadingContainer "maploadercontainer"
30+
MapProperties.MapContainer "mapcontainer"
3031
MapProperties.DefaultZoom 9
3132
MapProperties.DefaultCenter defaultCenter
32-
MapProperties.Center defaultCenter ]
33+
MapProperties.Center defaultCenter ]
34+
35+
## Markers
36+
37+
If you want to show markers on the map then you can create them like this:
38+
39+
let markers =
40+
locations
41+
|> Array.map (fun location ->
42+
marker [
43+
MarkerProperties.Key location.ID
44+
MarkerProperties.Position (Coordinates.newPos location.X location.Y)
45+
MarkerProperties.Icon (sprintf "Images/markers/%s.png" location.Color)
46+
MarkerProperties.Title location.Title] []))
47+
48+
49+
let myMap =
50+
googleMap [
51+
MapProperties.ApiKey googleMapApiKey
52+
// ..
53+
MapProperties.Markers (unbox markers) ]

0 commit comments

Comments
 (0)