Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to add my java business code in a javascript page?
    text
    copied!<p>Given a list of 'addresses' (String) I'm able to get the geocoding (latitude and longitude) in my Java code (Coordination Class). </p> <p>Armed with the geocoding results my objective is to put the coordinates in an HTML page. Using bing maps, I'm writing something like this: </p> <pre><code> function GetMap() { // Initialize the map map = new Microsoft.Maps.Map(document.getElementById("myMap"), {credentials:"MY_KEY_COMES_HERE"}); // Retrieve the location of the map center var center = map.getCenter(); var pins = new Microsoft.Maps.EntityCollection(); //[PASTE] this code is outputed by my java business code and later copy-paste here var position = new Microsoft.Maps.Location(21.1833927,-71.147288); var pin = new Microsoft.Maps.Pushpin(position); pins.push(pin) var position = new Microsoft.Maps.Location(21.1822191,-71.182732); var pin = new Microsoft.Maps.Pushpin(position); pins.push(pin) var position = new Microsoft.Maps.Location(22.1188265,-73.1515302); var pin = new Microsoft.Maps.Pushpin(position); pins.push(pin) var position = new Microsoft.Maps.Location(22.1901809,-72.9447259); var pin = new Microsoft.Maps.Pushpin(position); pins.push(pin) var position = new Microsoft.Maps.Location(21.1194505,-71.92582259999999); var pin = new Microsoft.Maps.Pushpin(position); pins.push(pin) //..rest of code comes here } </code></pre> <p>The code area inside the javascript is done manually; that is, I'm system.out the code under the word [PASTE]. At this moment, I'm doing it like this just to see that my coordinates are correct (I know, inefficient and dummy). </p> <p>So that brings me to my question: how can write directly to the HTML page (or javascript) without the manual work described above. Or, how do I combine my java business code with javascript? </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload