Hi!
I try to put in my app a map with drawingmanager active. The Asp page that contains the same code works, but in android application it does not appear on the map. Used code is:
Can someone tell me what am I doing wrong?
I need this to allow users to draw polygons on the map. If you can give me another option that can do this i'll thank you!
I try to put in my app a map with drawingmanager active. The Asp page that contains the same code works, but in android application it does not appear on the map. Used code is:
HTML:
<html>
<head>
<style type='text/css'>
html { height: 100% }
body { height: 100%; margin: 0px; padding: 0px }
#map_canvas { height: 100% }
</style>
<script type='text/javascript' src='http://maps.google.com/maps/api/js?sensor=true&libraries=drawing'></script>
<script type='text/javascript'>
var drawingManager; var myLatlng = new google.maps.LatLng(46.118134, 23.478782);
var map;
function initialize() {map = new google.maps.Map(document.getElementById('map_canvas'), {zoom: 12,center: myLatlng, mapTypeId: google.maps.MapTypeId.TERRAIN, mapTypeControlOptions: { style: google.maps.MapTypeControlStyle.DROPDOWN_MENU }, disableDefaultUI: true,zoomControl: true,streetViewControl: true, scrollwheel: true, disableDoubleClickZoom: false, draggable: true, keyboardShortcuts: true, mapTypeControl: true,navigationControl: true, scaleControl: true, mapTypeControlOptions: { style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR, position: google.maps.ControlPosition.TOP_RIGHT },navigationControlOptions: { style: google.maps.NavigationControlStyle.DEFAULT }})
var polyOptions = {strokeWeight: 0,fillOpacity: 0.45,editable: true}; drawingManager = new google.maps.drawing.DrawingManager({drawingMode: google.maps.drawing.OverlayType.POLYGON,drawingControlOptions: { drawingModes: [google.maps.drawing.OverlayType.POLYGON] },polygonOptions: polyOptions, map: map});
google.maps.event.addListener(map, 'click', function (myMouseEvent) { var clickedLocation = myMouseEvent.latLng.toUrlValue(); B4A.CallSub('HandleMapClick', true, clickedLocation); });
var marker1 = new google.maps.Marker({ position: new google.maps.LatLng(46.118134, 23.478782), map: map, title: 'A', clickable: true, draggable: true, icon: 'http://www.google.com/mapfiles/arrow.png' });}
google.maps.event.addDomListenerOnce(window, 'load', initialize);
</script>
</head>
<body onload=initialize()>
<div id='map_canvas' style='width:100%; height:100%'>
</div>
</body>
</html>
Can someone tell me what am I doing wrong?
I need this to allow users to draw polygons on the map. If you can give me another option that can do this i'll thank you!