Use the following code to create a inputEx MapField for Virtual Earth.
1 | var id = 'container1'; |
2 | var api = 'virtualearth'; |
3 | var elExample1 = new inputEx.MapField({parentEl: id, name: 'mapField', width: '800px', api: api}); |
4 | |
5 | var elButton1 = inputEx.cn('button', null, null, "getValue"); |
6 | YAHOO.util.Event.addListener(elButton1, 'click', function() { |
7 | alert(YAHOO.lang.JSON.stringify(elExample1.getValue()) ); |
8 | }); |
9 | YAHOO.util.Dom.get(id).appendChild(elButton1); |
view plain | print | ? |
Use the following code to create a inputEx MapField for Yahoo Maps.
1 | var id = 'container2'; |
2 | var api = 'yahoo'; |
3 | var elExample2 = new inputEx.MapField({parentEl: id, name: 'mapField', width: '800px', api: api}); |
4 | |
5 | var elButton2 = inputEx.cn('button', null, null, "getValue"); |
6 | YAHOO.util.Event.addListener(elButton2, 'click', function() { |
7 | alert( YAHOO.lang.JSON.stringify(elExample2.getValue()) ); |
8 | }); |
9 | YAHOO.util.Dom.get(id).appendChild(elButton2); |
view plain | print | ? |
Use the following code to create a inputEx MapField for Google Maps.
1 | var id = 'container3'; |
2 | var api = 'google'; |
3 | var elExample3 = new inputEx.MapField({parentEl: id, name: 'mapField', width: '800px', api: api}); |
4 | |
5 | var elButton3 = inputEx.cn('button', null, null, "getValue"); |
6 | YAHOO.util.Event.addListener(elButton3, 'click', function() { |
7 | alert( YAHOO.lang.JSON.stringify(elExample3.getValue()) ); |
8 | }); |
9 | YAHOO.util.Dom.get(id).appendChild(elButton3); |
view plain | print | ? |
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.
1 | var id = 'container4'; |
2 | var elExample4 = new inputEx.MapField({parentEl: id, name: 'mapField', width: '800px'}); |
3 | |
4 | var elButton4 = inputEx.cn('button', null, null, "getValue"); |
5 | YAHOO.util.Event.addListener(elButton4, 'click', function() { |
6 | alert( YAHOO.lang.JSON.stringify(elExample4.getValue()) ); |
7 | }); |
8 | YAHOO.util.Dom.get(id).appendChild(elButton4); |
view plain | print | ? |