Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 19
Registered: ‎03-28-2013
My Device: www
My Carrier: www
Accepted Solution

Google Maps Marker display in WebView

 When i set the marker with draggable : true, it shows the Pin correctly ...

 

There is anyone know how to slove the problem? please tell me。

 

Highlighted
Developer
Posts: 133
Registered: ‎05-10-2013
My Device: Blackberry Z10
My Carrier: -

Re: Google Maps Marker display in WebView

yaolei wrote: "it shows the Pin correctly ..."


Could you elaborate on your problem?

----------------------------------------
Remember to mark the thread as solved at the post that solved your problem, and if you like a post, like it!
Developer
Posts: 19
Registered: ‎03-28-2013
My Device: www
My Carrier: www

Re: Google Maps Marker display in WebView

I use Google Maps in the WebView. Code:

 

<!DOCTYPE html>
<html>
<head>
<title>Google Maps</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />


<link rel="stylesheet" href="local:///assets/style.css" type="text/css" media="screen" />

<script src="https://maps.googleapis.com/maps/api/js?sensor=true&libraries=places"></script>
<script src="local:///assets/google_map.js"></script>


<script type="text/javascript">
function load(){
initMaps();
}
</script>

</head>
<body>
<body onload="load()">
<div id="map_canvas"></div>

</body>
</html>

 

function initMaps() {

var myLat = 30.51667;
var myLon = 114.31667;
var rendererOptions = {
draggable: true
};
directionsDisplay = new google.maps.DirectionsRenderer(rendererOptions);

myLocation = new google.maps.LatLng(myLat, myLon);
var mapOptions = {
zoom : 14,
center : myLocation,
mapTypeId : google.maps.MapTypeId.ROADMAP,
panControl: false,
zoomControl: false,
mapTypeControl: false,
scaleControl: false,
streetViewControl: false,
overviewMapControl: false
};

googleMap = new google.maps.Map(document.getElementById("map_canvas"),
mapOptions);

initCenter(myLat, myLon);
var marker = new google.maps.Marker({
position: myLocation,
map: googleMap,
icon: 'local:///assets/images/user.png'
});

markersArray.push(marker);
i
service = new google.maps.places.PlacesService(googleMap);

directionsDisplay.setMap(googleMap);

 

}

 

The problem is:  the marker show incorrect.  It shows a big image in wrong place. But when i set zhe marker with draggable , it shows the image correctly;

 

 

 

Developer
Posts: 19
Registered: ‎03-28-2013
My Device: www
My Carrier: www

Re: Google Maps Marker display in WebView

I had slove the problem.
var marker = new google.maps.Marker({
position: myLocation,
map: googleMap,
icon: 'local:///assets/images/user.png',
optimized: false
});

add optimized: false.......
Developer
Posts: 692
Registered: ‎08-09-2010
My Device: Not Specified

Re: Google Maps Marker display in WebView

May i know how to show multiple pin ??