inputEx - MapField Usage

Virtual Earth MapField creation

Use the following code to create a inputEx MapField for Virtual Earth.

loading....
1var id = 'container1'
2var api = 'virtualearth'
3var elExample1 = new inputEx.MapField({parentEl: id, name: 'mapField', width: '800px', api: api}); 
4 
5var elButton1 = inputEx.cn('button'nullnull"getValue"); 
6YAHOO.util.Event.addListener(elButton1, 'click'function() { 
7    alert(YAHOO.lang.JSON.stringify(elExample1.getValue()) ); 
8}); 
9YAHOO.util.Dom.get(id).appendChild(elButton1); 
view plain | print | ?

Yahoo Maps MapField creation

Use the following code to create a inputEx MapField for Yahoo Maps.

loading....
1var id = 'container2'
2var api = 'yahoo'
3var elExample2 = new inputEx.MapField({parentEl: id, name: 'mapField', width: '800px', api: api}); 
4 
5var elButton2 = inputEx.cn('button'nullnull"getValue"); 
6YAHOO.util.Event.addListener(elButton2, 'click'function() { 
7    alert( YAHOO.lang.JSON.stringify(elExample2.getValue()) ); 
8}); 
9YAHOO.util.Dom.get(id).appendChild(elButton2); 
view plain | print | ?

Google Maps MapField creation

Use the following code to create a inputEx MapField for Google Maps.

loading....
1var id = 'container3'
2var api = 'google'
3var elExample3 = new inputEx.MapField({parentEl: id, name: 'mapField', width: '800px', api: api}); 
4 
5var elButton3 = inputEx.cn('button'nullnull"getValue"); 
6YAHOO.util.Event.addListener(elButton3, 'click'function() { 
7    alert( YAHOO.lang.JSON.stringify(elExample3.getValue()) ); 
8}); 
9YAHOO.util.Dom.get(id).appendChild(elButton3); 
view plain | print | ?

Default MapField creation

Use the following code to create a inputEx MapField for whatever the default API is. We should complete this example by making buttons to change the default and store that in cookies.

loading....
1var id = 'container4'
2var elExample4 = new inputEx.MapField({parentEl: id, name: 'mapField', width: '800px'}); 
3 
4var elButton4 = inputEx.cn('button'nullnull"getValue"); 
5YAHOO.util.Event.addListener(elButton4, 'click'function() { 
6    alert( YAHOO.lang.JSON.stringify(elExample4.getValue()) ); 
7}); 
8YAHOO.util.Dom.get(id).appendChild(elButton4); 
view plain | print | ?