var map = new OpenLayers.Map("salt-lake-city-UT-first-choice-money-center");map.addLayer(new OpenLayers.Layer.OSM("OpenStreetMap", ['//a.tile.openstreetmap.org/${z}/${x}/${y}.png','//b.tile.openstreetmap.org/${z}/${x}/${y}.png','//c.tile.openstreetmap.org/${z}/${x}/${y}.png'], null)); var zoom=9;var lonLat = new OpenLayers.LonLat( -111.899, 40.7564 ).transform(new OpenLayers.Projection("EPSG:4326"),map.getProjectionObject());map.setCenter (lonLat, zoom);$geo('4071 W 5415 S, Salt Lake City, UT 84118', '8d1ea5fe', 'eafcf8ae');$geo('4132 S Redwood Rd, Salt Lake City, UT 84123', 'cb771229', 'eafcf8ae');$geo('190 E 3300 S, Salt Lake City, UT 84115', '72fd6012', 'eafcf8ae');$geo('2470 S Redwood Rd, Salt Lake City, UT 84119', '0f7b7580', 'eafcf8ae');function $setCenter($lon, $lat){map.setCenter(new OpenLayers.LonLat($lon,$lat).transform(new OpenLayers.Projection('EPSG:4326'), map.getProjectionObject() ), 18);}function $geo($location, $hash, $hash2){var $geocode = 'https://nominatim.openstreetmap.org/search?q='+$location+'&format=json'; $.getJSON($geocode, function(data) {var lonLat = new OpenLayers.LonLat( data[0]['lon'] , data[0]['lat'] ).transform(new OpenLayers.Projection("EPSG:4326"),map.getProjectionObject());var markers = new OpenLayers.Layer.Markers( "Markers" );map.addLayer(markers);markers.addMarker(new OpenLayers.Marker(lonLat));map.setCenter (lonLat, 12);document.getElementById($hash).innerHTML += ' | View Map';});}