openlayers / ol2

OpenLayers v2 - deprecated!
Other
1.48k stars 771 forks source link

Need to add set style feature to Google Layer #1522

Open balab2020 opened 6 years ago

balab2020 commented 6 years ago

We are trying to use Google Map custom styles feature to style the map. It is possible to have from OL google layer since it create map instance using google api.

How can I make changes and contribute here?

Code snippet on this issue.

OpenLayers.Layer.Google.prototype.setstyle = function () {
              this.type = 'styled';
              var mapStyle = [];
              var styledMapType = new window.google.maps.StyledMapType(mapStyle, { name: "styled" });
              var googleMapObj = mapLayer.mapObject;
              googleMapObj.mapTypes.set('styled', styledMapType);
              googleMapObj.setMapTypeId('styled');
}
balab2020 commented 6 years ago

Created Pull Request https://github.com/openlayers/ol2/pull/1523