feat(google-maps): Implemented map feature functions (i.e. GeoJSON support)
This PR adds support (first implementation scoped to geoJson) for map features.
Examples
addFeatures(type: FeatureType, data: any, idPropertyName: string, styles: FeatureStyles): string[]
await map.addFeatures(
FeatureType.GeoJSON,
{
type: 'Feature',
geometry: GeoJSONData,
properties: {
id: 'my-identifier',
},
},
'id',
{
['my-identifier']: {
strokeColor: '#123456',
strokeOpacity: 0.8,
strokeWeight: 1,
fillColor: '#654321',
fillOpacity: 0.1,
geodesic: true,
}
}
)
getFeatureBounds(featureId: string)
map.getFeatureBounds('my-identifier')
removeFeature(featureId: string)
map.removeFeature('my-identifier')
Closes https://github.com/ionic-team/capacitor-plugins/issues/1604
I see. Seems that I only took the case with an id into account, because I only use it with styles :) You are absolutely correct, this should be an optional parameter.
Did you mean that you are going to rework it, or advised me to do so? I would be glad about support.
Sorry, I meant for you to make the changes. If you can't, no big deal, we'll slot some time for us to work on it.
I just pushed some more changes to make the idPropertyName and styles parameter optional. Looks good for me in Android. In iOS I just made the code adjustments but I am not able to test it right now. Would be great if you could have another look.
Well, I think with the commit in August I broke it completely. Should be fixed now.
Moved https://github.com/ionic-team/capacitor-google-maps/pull/19