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

Web and WebWorks Development

New Contributor
Posts: 6
Registered: ‎10-10-2012
My Device: BlackBerry 10 Dev Alpha
My Carrier: Sprint

Google Maps API - Markers Not Showing

i'm using html5 geolocation and google maps api, it works 100% fine in browser but when i use ripple/webworks in chrome and/or deploy to my BB10 Dev Alpha, the markers don't show up. the map works and it picks up my longitude and latitude but the locations aren't there. any ideas?


my config.xml is:

<?xml version="1.0" encoding="utf-8"?>
<widget xmlns:rim="http://www.blackberry.com/ns/widgets" id="BB10Pure" version="" rim:header="RIM-Widget:rim/widget" xmlns="http://www.w3.org/ns/widgets">
    <rim:navigation mode="focus" />
    <name>BB10 Pure</name>
    <author href="https://twitter.com/whomikey">Michael Lorig</author>
    <icon src="assets/images/bb10-icon.png" />
    <icon src="assets/images/bb10-icon.png" rim:hover="true" />
    <rim:splash src="assets/images/bb10-splash-portrait.png" />
    <access uri="*" subdomains="true" />
    <access uri="https://maps.googleapis.com/maps/api/js" subdomains="true" />
    <feature id="blackberry.app.orientation">
        <param name="mode" value="portrait" />
    <feature id="blackberry.push" />
    <feature id="blackberry.message.sms" />
    <feature id="blackberry.ui.menu" />
    <feature id="blackberry.ui.dialog"/>
    <feature id="blackberry.ui.toast" />
    <feature id="blackberry.identity" />
    <feature id="blackberry.system.event" />
    <feature id="blackberry.app" />
    <feature id="blackberry.app.event"/>
    <content src="index.html" />


my location.html is:

<style type="text/css">
#map_canvas {
    width: 768px;
    height: 1029px;
<script type="text/javascript"> var infowindow = null; $(document).ready(function () { initialize(); }); function initialize() { var centerMap = new google.maps.LatLng(myLat, myLong); var myOptions = { zoom: 10, center: centerMap, mapTypeId: google.maps.MapTypeId.ROADMAP } var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); setMarkers(map, sites); infowindow = new google.maps.InfoWindow({ content: "loading..." }); var bikeLayer = new google.maps.BicyclingLayer(); bikeLayer.setMap(map); } var sites = [ ['Loosmore Castle', 34.097328, -118.221836, 1, 'This is our house.'], ['Glendale Galleria', 34.146284, -118.255567, 2, 'This is where we shop.'], ['Glassell Park School', 34.104506, -118.237028, 3, 'This is where kids learn.'] ]; function setMarkers(map, markers) { for (var i = 0; i < markers.length; i++) { var sites = markers[i]; var siteLatLng = new google.maps.LatLng(sites[1], sites[2]); var marker = new google.maps.Marker({ position: siteLatLng, map: map, title: sites[0], zIndex: sites[3], html: sites[4] }); var contentString = 'Some content'; google.maps.event.addListener(marker, 'click', function () { alert(this.html); infowindow.setContent(this.html); infowindow.open(map, this); }); } } </script> <div id="map_canvas"></div>


in the head, i do include webworks, jquery and google maps api with the html5 geolocation function to get "myLat" and "myLong"



Posts: 43
Registered: ‎10-03-2008
My Device: Not Specified

Re: Google Maps API - Markers Not Showing

Did you ever find a solution to this? I'm seeing the same issue.

Posts: 676
Registered: ‎05-06-2012
My Device: Dev Alpha & PlayBook
My Carrier: wifi

Re: Google Maps API - Markers Not Showing

Posting so I can get updates on this as well.

P.S. as you may have noticed <access uri="*" subdomains="true" /> doesn't have any effect on the new SDKs.

I haven't tried it but this might work in place of it...

<feature id="blackberry.app">
<param name="websecurity" value="disable" />

from https://developer.blackberry.com/html5/documentation/param_element.html
co-founder of Diaree | BB Dev for PictureThis