We are trying to integrate the Google map to our product by using the follow html code.
Smart Client Version : Version v8.3p_2013-08-15/PowerEdition Development Only (2013-08-15)
Browser: FireFox 12
We have tried with HtmlFlow, but script block can be executed only if we use contentUrl, so we tried the follow SC code in the feature explorer.
The url points to the html at the top.
We have also tried another way that use fileLoader’s loadJSFiles to import google map’s source and execute script
We also tried the cavans
However, after we click the “try it” button, in all three ways,the page loads forever.
Is there any other to integrate the top html into smartclient ui to see Google map?
Smart Client Version : Version v8.3p_2013-08-15/PowerEdition Development Only (2013-08-15)
Browser: FireFox 12
Code:
<!DOCTYPE html> <html> <head> <title>Simple Map</title> <meta name="viewport" content="initial-scale=1.0, user-scalable=no"> <meta charset="utf-8"> <style> html, body, #map-canvas { margin: 0; padding: 0; height: 100%; } </style> <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script> <script> var map; function initialize() { var mapOptions = { zoom: 8, center: new google.maps.LatLng(-34.397, 150.644), mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); } google.maps.event.addDomListener(window, 'load', initialize); </script> </head> <body> <div id="map-canvas"></div> </body> </html>
Code:
isc.HTMLFlow.create({ width:230, styleName:"exampleTextBlock", contentsURL:"https://google-developers.appspot.com/maps/documentation/javascript/examples/full/map-simple" })
We have also tried another way that use fileLoader’s loadJSFiles to import google map’s source and execute script
Code:
var map = isc.HTMLFlow.create({ width:230, styleName:"exampleTextBlock", contents:"<div id='map-canvas'></div>" }) map.draw(); isc.FileLoader.loadJSFiles("https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false", "function googleMap() {"+ "function initialize() {"+ "var map;"+ "var mapOptions = {"+ "zoom: 8,"+ "center: new google.maps.LatLng(-34.397, 150.644),"+ "mapTypeId: google.maps.MapTypeId.ROADMAP"+ "};"+ "map = new google.maps.Map(document.getElementById('map-canvas'),"+ "mapOptions);"+ "}"+ "google.maps.event.addDomListener(window, 'load', initialize);"+ "}" );
We also tried the cavans
Code:
var html= "<!DOCTYPE html>"+ "<html>"+ "<body>"+ "<div>"+ "<script"+ "src='http://maps.googleapis.com/maps/api/js?key=AIzaSyDY0kkJiTPVd2U7aTOAwhc9ySH6oHxOIYM&sensor=false'>"+ "<script>var map;"+ "function initialize()"+ "{"+ "var mapProp = {"+ "center:new google.maps.LatLng(51.508742,-0.120850),"+ "zoom:5,"+ "mapTypeId:google.maps.MapTypeId.ROADMAP"+ "};"+ "map=new google.maps.Map(document.getElementById('googleMap'),mapProp);"+ "}"+ "google.maps.event.addDomListener(window, 'load', initialize);"+ "</script>"+ "<div id='googleMap' style='width:500px;height:380px;'></div>"+ "</div>"+ "</body>"+ "</html>" var canvas = isc.Canvas.create({ getInnerHtml: function() { return html; } });
Is there any other to integrate the top html into smartclient ui to see Google map?
Comment