Ce projet est le port de Google-Map WebComponent basé sur la bibliothèque LIT V2.
Mise à jour v1.0.0 (23/02/2022)
Comment utiliser
Attributs de l'élément de carte
Attributs de l'élément de marqueur
Attributs de l'élément de forme de cercle
Attributs de l'élément de forme de polygone
Comment construire
Licence
Inclure le bundle Lit-Google-Map dans le fichier HTML:
< script src =" lit-google-map.bundle.js " > </ script >
ou sa version minifiée:
< script src =" lit-google-map.bundle.min.js " > </ script >
Utilisez le composant dans n'importe quel endroit que vous souhaitez (n'oubliez pas de remplir la clé de l'API Google Maps):
< lit-google-map api-key =" YOUR_GOOGLE_MAPS_API_KEY " >
</ lit-google-map >
Vous pouvez également inclure n'importe quel nombre de marqueurs de carte:
< lit-google-map api-key =" YOUR_GOOGLE_MAPS_API_KEY " >
< lit-google-map-marker slot =" markers " latitude =" 49.4404582 " longitude =" 20.2700361 " >
</ lit-google-map-marker >
< lit-google-map-marker slot =" markers " latitude =" 50.797444 " longitude =" 20.4600623 " >
</ lit-google-map-marker >
</ lit-google-map >
ou / et formes:
< lit-google-map api-key =" YOUR_GOOGLE_MAPS_API_KEY " >
< lit-google-map-circle slot =" shapes " center-latitude =" 49.4404582 " center-longitude =" 20.2700361 " >
</ lit-google-map-circle >
</ lit-google-map >
Exemple:
< lit-google-map api-key =" SOME_API_KEY " zoom =" 6 " map-type =" satellite " center-latitude =" 51.8436554 " center-longitude =" 19.5070867 " >
</ lit-google-map >
Exemple:
< lit-google-map-marker slot =" markers " latitude =" 49.4404582 " longitude =" 20.2700361 " >
</ lit-google-map-marker >
Les marqueurs peuvent également avoir une infoindow associée avec un contenu HTML:
< lit-google-map-marker slot =" markers " latitude =" 50.797444 " longitude =" 20.4600623 " >
< p > Some description </ p >
< img src =" some_image.jpg " alt =" some image " >
</ lit-google-map-marker >
Exemple:
< lit-google-map-circle slot =" shapes " center-latitude =" 53.176389 " center-longitude =" 22.073056 " radius =" 50000 " fill-color =" #7FB3D5 " fill-opacity =" 0.35 " stroke-color =" #2874A6 " stroke-opacity =" 0.8 " stroke-weight =" 5 " >
</ lit-google-map-circle >
Exemple:
< lit-google-map-polygon slot =" shapes " paths =' [{"lat": 53.7332, "lng": 15.5180}, {"lat": 54.0444, "lng": 18.1379}, {"lat": 53.2028, "lng": 16.9292}, {"lat": 53.7332, "lng": 15.5180}] ' fill-color =" #7FB3D5 " fill-opacity =" 0.35 " stroke-color =" #2874A6 " stroke-opacity =" 0.8 " stroke-weight =" 5 " >
</ lit-google-map-polygon >
Avant la construction, installez tous les packages requis:
npm install
Construction nue:
npm run build
Construire avec étape du paquet:
npm run bundle
Mit