Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var filename = window.location.pathname.replace(/^.*(\\|\/|\:)/, '');
- function mapview() {
- var map;
- var geocoder;
- obj('markerfloat').innerHTML = "Jeep Wrangler<br>Address: Irving Place<br>Speed: 0 MPH <br>Direction: N";
- obj('refrehUnits').parentElement.removeChild(obj('refrehUnits'));
- obj('landmarkStatus').parentElement.parentElement.removeChild(obj('landmarkStatus').parentElement);
- geocoder = new google.maps.Geocoder();
- var latlng = new google.maps.LatLng(41.0426984, -73.8597068);
- var mapOptions = {
- zoom: 25,
- center: latlng,
- mapTypeId: google.maps.MapTypeId.HYBRID
- };
- map = new google.maps.Map(document.getElementById("mapCanvas"), mapOptions);
- var address = "Irving Place, Irvington, NY";
- geocoder.geocode({
- 'address': address
- }, function (results, status) {
- if (status == google.maps.GeocoderStatus.OK) {
- map.setCenter(results[0].geometry.location);
- var icon1 = "http://www.guidepointsystems.com/fleet/img/dark/icons/fleet_small.png";
- var icon2 = "http://www.guidepointsystems.com/fleet/img/dark/icons/fleet_small_over.png";
- var marker = new google.maps.Marker({
- position: latlng,
- map: map,
- icon: icon1
- });
- google.maps.event.addListener(marker, 'mousemove', function (event) {
- marker.setIcon(icon2);
- var float = obj('markerfloat');
- try {
- float.style.left = (window.event.clientX + 12) + "px";
- if (navigator.appName == "Microsoft Internet Explorer") {
- float.style.top = (window.event.clientY - 16 + document.documentElement.scrollTop) + "px";
- }
- else {
- float.style.top = (window.event.clientY - 16 + window.pageYOffset) + "px";
- }
- } catch (e) {}
- });
- google.maps.event.addListener(marker, 'mouseover', function () {
- marker.setIcon(icon2);
- obj('markerfloat').style.display = 'block';
- });
- google.maps.event.addListener(marker, 'mouseout', function () {
- marker.setIcon(icon1);
- obj('markerfloat').style.display = 'none';
- });
- }
- });
- }
- function landing() {
- var map;
- var geocoder;
- obj('vehicle_locate_button').parentElement.removeChild(obj('vehicle_locate_button'));
- geocoder = new google.maps.Geocoder();
- var latlng = new google.maps.LatLng(41.0426984, -73.8597068);
- var mapOptions = {
- zoom: 17,
- center: latlng,
- draggable : false,
- mapTypeId: google.maps.MapTypeId.HYBRID
- };
- map = new google.maps.Map(document.getElementById("map_container"), mapOptions);
- var address = "Irving Place, Irvington, NY";
- geocoder.geocode({
- 'address': address
- }, function (results, status) {
- if (status == google.maps.GeocoderStatus.OK) {
- map.setCenter(results[0].geometry.location);
- var marker = new google.maps.Marker({
- map: map,
- position: results[0].geometry.location
- });
- }
- });
- }
- var runIt = function() {
- if (filename == "landing") {landing();}
- if (filename == "mapview") {mapview();}
- }
- var checkLoad = function() {
- document.readyState !== "complete" ? setTimeout(checkLoad,11) : runIt();
- };
- checkLoad();
- console.log(filename)
Advertisement
Add Comment
Please, Sign In to add comment