mercredi 4 février 2015

Google Map Icon Change From an if Statement

im trying to make an icon for an oil well site change when an alarm goes off at the site. the alarm is hooked up to a static ip and the web address given either gives a 1 or a 0 so i want to make its so that when that web address content equals 0 it will change the icon. (the code below is not the proper ip i'm aware of that)



function initialize() {
currentPosition = new google.maps.LatLng(myLat,myLon);

var map_canvas = document.getElementById('map_canvas');
var map_options = {
center: new google.maps.LatLng(46, -100),
zoom: 7,
mapTypeId: google.maps.MapTypeId.TERRAIN,
styles: [{'featureType':'water','stylers':[{'visibility':'on'},{'color':'#008FB2'}]},{'featureType':'landscape','stylers':[{'color':'#f2e5d4'}]}]

}
var map = new google.maps.Map(map_canvas, map_options);

var point = new google.maps.LatLng(47, -100);
var marker = new google.maps.Marker ({
position: currentPosition,
map: map,

title: 'Rig Site: 1AW-5D'});
var customIcons = {
'http://ift.tt/1KsQJVH'="0": {
icon: 'PointMarker.png';
},
'http://ift.tt/1KsQJVH'="1": {
icon: 'PointMarker2.png',
}
};

Aucun commentaire:

Enregistrer un commentaire