Skip to content

Commit d1201e1

Browse files
authored
Add files via upload
fix for center="{{latLngString}}" - now creates google latLng from string
1 parent cd193c4 commit d1201e1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

controllers/map-controller.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@
174174
((typeof center === 'string') && center.match(/\{\{.*\}\}/))
175175
) {
176176
mapOptions.center = new google.maps.LatLng(0, 0);
177+
} else if( (typeof center === 'string') && center.match(/[0-9.-]*,[0-9.-]*/) ){
178+
mapOptions.center = new google.maps.LatLng(center);
177179
} else if (!(center instanceof google.maps.LatLng)) {
178180
var geoCenter = mapOptions.center;
179181
delete mapOptions.center;

0 commit comments

Comments
 (0)