mukil / Leaflet.annotate

A Leaflet plugin integrating schema.org to markup items in your geographic web map machine readable.
http://mukil.github.io/Leaflet.annotate/
BSD 2-Clause "Simplified" License
10 stars 5 forks source link

Assist third party developers with an object containing valid values for 'itemtype' and 'geoprop' #7

Open mukil opened 8 years ago

mukil commented 8 years ago

If another party wants to integrate this extension into their web mapping application they will need/want to provide some kind of mechanism so users re-use valid schema.org type names. Otherwise major search engines would not now what the web map element is about.

mukil commented 8 years ago

Two commits in that direction:

mukil commented 7 years ago

The utility API for input validation is:

isValidItemTypeName(userInput); // L.marker(.., { options: { itemtype: "city" } } )
isValidItemTypeProperty(typeName, propertyName);
isValidPlaceProperty(propertyName);

Annotations are just generated if all these methods return true.

mukil commented 7 years ago

https://github.com/mukil/Leaflet.annotate/blob/master/src/Leaflet.annotate.types.de_DE.js https://github.com/mukil/Leaflet.annotate/blob/master/src/Leaflet.annotate.types.en_US.js