Skip to content

Instantly share code, notes, and snippets.

@aimenkhakwani
Created September 21, 2017 17:39
Show Gist options
  • Save aimenkhakwani/092ed60cd553f1553c02363c3a265a25 to your computer and use it in GitHub Desktop.
Save aimenkhakwani/092ed60cd553f1553c02363c3a265a25 to your computer and use it in GitHub Desktop.
diff --git a/js/geolocation-common-map.js b/js/geolocation-common-map.js
index 0b14d3f..b021281 100644
--- a/js/geolocation-common-map.js
+++ b/js/geolocation-common-map.js
@@ -373,7 +373,20 @@
};
if (typeof location.data('icon') !== 'undefined') {
- markerConfig.icon = location.data('icon');
+ if (location.data('labelOriginX') !== 'undefined' &&
+ location.data('labelOriginY') !== 'undefined') {
+ markerConfig.icon = {
+ url: location.data('icon'),
+ labelOrigin: new google.maps.Point(location.data('labelOriginX'),location.data('labelOriginY'))
+ };
+ }
+ else {
+ markerConfig.icon = location.data('icon');
+ }
+
+ if (location.data('scaledWidth') !== 'undefined' && location.data('scaledHeight') !== 'undefined') {
+ markerConfig.icon.scaledSize = new google.maps.Size(location.data('scaledWidth'),location.data('scaledHeight'))
+ }
}
if (typeof location.data('markerLabel') !== 'undefined') {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment