<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>Nokia Developer Community - Discussions - Maps API for Javascript</title>
		<link>http://www.developer.nokia.com/Community/Discussion/</link>
		<description>Add interactive HERE Maps to your website. See  the wiki for community articles.</description>
		<language>en</language>
		<lastBuildDate>Wed, 22 May 2013 03:05:56 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://www.developer.nokia.com/Community/Discussion/images/misc/rss.png</url>
			<title>Nokia Developer Community - Discussions - Maps API for Javascript</title>
			<link>http://www.developer.nokia.com/Community/Discussion/</link>
		</image>
		<item>
			<title>Bitmap icon and transparent backround color</title>
			<link>http://www.developer.nokia.com/Community/Discussion/showthread.php?240374-Bitmap-icon-and-transparent-backround-color&amp;goto=newpost</link>
			<pubDate>Wed, 15 May 2013 09:32:53 GMT</pubDate>
			<description>I have custom bitmap icons which have different backround colors.  
I can show icons (with backround color) on map as normal Markers but how do i can get backround color transparent?</description>
			<content:encoded><![CDATA[<div>I have custom bitmap icons which have different backround colors. <br />
I can show icons (with backround color) on map as normal Markers but how do i can get backround color transparent?</div>

]]></content:encoded>
			<category domain="http://www.developer.nokia.com/Community/Discussion/forumdisplay.php?283-Maps-API-for-Javascript">Maps API for Javascript</category>
			<dc:creator>mr. dude</dc:creator>
			<guid isPermaLink="true">http://www.developer.nokia.com/Community/Discussion/showthread.php?240374-Bitmap-icon-and-transparent-backround-color</guid>
		</item>
		<item>
			<title>Get address from infoBubbles</title>
			<link>http://www.developer.nokia.com/Community/Discussion/showthread.php?240329-Get-address-from-infoBubbles&amp;goto=newpost</link>
			<pubDate>Mon, 13 May 2013 04:58:14 GMT</pubDate>
			<description>Hello 
 
I am using the following code, and when click on an address from resultList, an infobubble pops-up from the marker with the address details, such as street name, city etc. 
 
I just wondering if I can get these address details form the infobubble, or how to get these values from...</description>
			<content:encoded><![CDATA[<div>Hello<br />
<br />
I am using the following code, and when click on an address from resultList, an infobubble pops-up from the marker with the address details, such as street name, city etc.<br />
<br />
I just wondering if I can get these address details form the infobubble, or how to get these values from mapResultList by using nokia.places.search.manager.reverseGeoCode?<br />
<br />
Many Thanks!<br />
<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code"><br />
&nbsp; &nbsp; &nbsp; &nbsp; var infoBubbles = new nokia.maps.map.component.InfoBubbles();<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; var map = new nokia.maps.map.Display(document.getElementById(&quot;mapContainer&quot;),<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  &quot;components&quot;: [<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  infoBubbles,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  new nokia.maps.map.component.ZoomBar(),<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  new nokia.maps.map.component.Behavior(),<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  new nokia.maps.map.component.TypeSelector(),<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  new nokia.maps.map.component.ContextMenu()],<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  &quot;zoomLevel&quot;: 9,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  &quot;center&quot;: [-27.471011, 153.023449]<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  });<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; var mapPlaceWidget = new nokia.places.widgets.Place({<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; map: map<br />
&nbsp; &nbsp; &nbsp; &nbsp; });<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; var mapResultList = new nokia.places.widgets.ResultList({<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; targetNode: &quot;mapResultlist&quot;,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; map: map,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; onRenderPage: function () {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mapResultList.displayOnMap();<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; events: [<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rel: &quot;nokia-place-name&quot;,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name: &quot;click&quot;,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; handler: function (place2) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mapPlaceWidget.setPlace({ href: place2.href });<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ]<br />
&nbsp; &nbsp; &nbsp; &nbsp; })<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; var mapSb = new nokia.places.widgets.SearchBox({<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; targetNode: &quot;mapSearchbox&quot;,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; map: map,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; onResults: function (data) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mapResultList.setData(data);<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; });</code><hr />
</div></div>

]]></content:encoded>
			<category domain="http://www.developer.nokia.com/Community/Discussion/forumdisplay.php?283-Maps-API-for-Javascript">Maps API for Javascript</category>
			<dc:creator>Summerd</dc:creator>
			<guid isPermaLink="true">http://www.developer.nokia.com/Community/Discussion/showthread.php?240329-Get-address-from-infoBubbles</guid>
		</item>
		<item>
			<title>Change initial scale unit</title>
			<link>http://www.developer.nokia.com/Community/Discussion/showthread.php?240281-Change-initial-scale-unit&amp;goto=newpost</link>
			<pubDate>Thu, 09 May 2013 16:38:04 GMT</pubDate>
			<description><![CDATA[Hello, 
 
I would like to change the initial unit used by the scale component of a map, so I can force it to match my user's preferences. I've tried using the switchUnit method of the scale bar component, but it doesn't appear to change the scale's units. 
 
Is this the correct way to achieve this,...]]></description>
			<content:encoded><![CDATA[<div>Hello,<br />
<br />
I would like to change the initial unit used by the scale component of a map, so I can force it to match my user's preferences. I've tried using the switchUnit method of the scale bar component, but it doesn't appear to change the scale's units.<br />
<br />
Is this the correct way to achieve this, or am I missing something ?<br />
<br />
Regards</div>

]]></content:encoded>
			<category domain="http://www.developer.nokia.com/Community/Discussion/forumdisplay.php?283-Maps-API-for-Javascript">Maps API for Javascript</category>
			<dc:creator>alexsigmarh</dc:creator>
			<guid isPermaLink="true">http://www.developer.nokia.com/Community/Discussion/showthread.php?240281-Change-initial-scale-unit</guid>
		</item>
		<item>
			<title>Map Image</title>
			<link>http://www.developer.nokia.com/Community/Discussion/showthread.php?240256-Map-Image&amp;goto=newpost</link>
			<pubDate>Wed, 08 May 2013 21:19:05 GMT</pubDate>
			<description><![CDATA[Hi. 
 
I need to get a map image in order to save it into a file, I know that there is a API to load static maps trough an url (REST API), but the problem is that it's very limited and it's not usefull for what I'm doing, because I need to get an image of a map that contains a large number of...]]></description>
			<content:encoded><![CDATA[<div>Hi.<br />
<br />
I need to get a map image in order to save it into a file, I know that there is a API to load static maps trough an url (REST API), but the problem is that it's very limited and it's not usefull for what I'm doing, because I need to get an image of a map that contains a large number of objects (markers, shapes, bubbles,etc) and with the REST API I can't do this.<br />
<br />
On the other hand, I know that the map is an image, so I've tried to render the content of the DOM  and painted in a canvas in order to convert it's content to an image, but It doesn´t work because the images of the map are in the server, not in the client.<br />
<br />
Does somebody know how can I solve this?<br />
<br />
Regards.</div>

]]></content:encoded>
			<category domain="http://www.developer.nokia.com/Community/Discussion/forumdisplay.php?283-Maps-API-for-Javascript">Maps API for Javascript</category>
			<dc:creator>ing.luismontesdeoca</dc:creator>
			<guid isPermaLink="true">http://www.developer.nokia.com/Community/Discussion/showthread.php?240256-Map-Image</guid>
		</item>
		<item>
			<title>Probleme wtih mailto: and nokai maps</title>
			<link>http://www.developer.nokia.com/Community/Discussion/showthread.php?240240-Probleme-wtih-mailto-and-nokai-maps&amp;goto=newpost</link>
			<pubDate>Tue, 07 May 2013 08:59:18 GMT</pubDate>
			<description><![CDATA[Hi,  
 
I have a problem with the map api for javascript : i have a link in the footer of my website where users can send mail to us.  
 
I have a <a href="mailto:exemple@mail.com" > when i click on it the map disappear. I have to refresh the page in order to see the map !  
 
it's normal ?  
 
...]]></description>
			<content:encoded><![CDATA[<div>Hi, <br />
<br />
I have a problem with the map api for javascript : i have a link in the footer of my website where users can send mail to us. <br />
<br />
I have a &lt;a href=&quot;mailto:exemple@mail.com&quot; &gt; when i click on it the map disappear. I have to refresh the page in order to see the map ! <br />
<br />
it's normal ? <br />
<br />
<br />
thank you;)</div>

]]></content:encoded>
			<category domain="http://www.developer.nokia.com/Community/Discussion/forumdisplay.php?283-Maps-API-for-Javascript">Maps API for Javascript</category>
			<dc:creator>rochedy</dc:creator>
			<guid isPermaLink="true">http://www.developer.nokia.com/Community/Discussion/showthread.php?240240-Probleme-wtih-mailto-and-nokai-maps</guid>
		</item>
		<item>
			<title>Can map API use POSTAL CODE (zip code) instead of Long/Lat ??</title>
			<link>http://www.developer.nokia.com/Community/Discussion/showthread.php?240204-Can-map-API-use-POSTAL-CODE-(zip-code)-instead-of-Long-Lat&amp;goto=newpost</link>
			<pubDate>Fri, 03 May 2013 19:38:52 GMT</pubDate>
			<description><![CDATA[I can draw a simple map using geocode data: 
 
 
Code: 
--------- 
var map = new nokia.maps.map.Display(document.getElementById("map"), 
{components:[ new nokia.maps.map.component.Behavior(),],'zoomLevel': 12,'center':[41.8885694, -87.6355278]}); 
--------- 
But I'd like to be able to submit a map...]]></description>
			<content:encoded><![CDATA[<div>I can draw a simple map using geocode data:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">var map = new nokia.maps.map.Display(document.getElementById(&quot;map&quot;),<br />
{components:[ new nokia.maps.map.component.Behavior(),],'zoomLevel': 12,'center':[41.8885694, -87.6355278]});</code><hr />
</div>But I'd like to be able to submit a map request using postal code (zip code) that will return the centroid geocode of that area. <br />
Does the nokia maps API support that?<br />
<br />
Thanks,<br />
<br />
 - Michael</div>

]]></content:encoded>
			<category domain="http://www.developer.nokia.com/Community/Discussion/forumdisplay.php?283-Maps-API-for-Javascript">Maps API for Javascript</category>
			<dc:creator>slsmag</dc:creator>
			<guid isPermaLink="true">http://www.developer.nokia.com/Community/Discussion/showthread.php?240204-Can-map-API-use-POSTAL-CODE-(zip-code)-instead-of-Long-Lat</guid>
		</item>
		<item>
			<title>How can I retrieve a decimal latitude / longitude when dragging a marker?</title>
			<link>http://www.developer.nokia.com/Community/Discussion/showthread.php?240171-How-can-I-retrieve-a-decimal-latitude-longitude-when-dragging-a-marker&amp;goto=newpost</link>
			<pubDate>Wed, 01 May 2013 01:43:07 GMT</pubDate>
			<description>I have the following code which will update a textbox with latitude / longtitude of a location when I drag a marker on the map to its location: 
 
 
Code: 
--------- 
var listener = function (evt) { 
    /* We check if this drag listener is called while the marker is being 
        * dragged using...</description>
			<content:encoded><![CDATA[<div>I have the following code which will update a textbox with latitude / longtitude of a location when I drag a marker on the map to its location:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">var listener = function (evt) {<br />
&nbsp; &nbsp; /* We check if this drag listener is called while the marker is being<br />
&nbsp; &nbsp; &nbsp; &nbsp; * dragged using the default behavior component<br />
&nbsp; &nbsp; &nbsp; &nbsp; */<br />
&nbsp; &nbsp; var mapDragType = evt.dataTransfer.getData(&quot;application/map-drag-type&quot;);<br />
<br />
&nbsp; &nbsp; if (mapDragType === &quot;marker&quot;) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; // Get the marker itself.<br />
&nbsp; &nbsp; &nbsp; &nbsp; var marker = evt.dataTransfer.getData(&quot;application/map-drag-object&quot;);<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; // Get the offset of the mouse relative to the top-left corner of the marker.<br />
&nbsp; &nbsp; &nbsp; &nbsp; var offset = evt.dataTransfer.getData(&quot;application/map-drag-object-offset&quot;);<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; /* Calculate the current coordinate of the marker, so substract the offset from the <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; * current displayX/Y position to get the top-left position of the marker and then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; * add the anchor to get the pixel position of the anchor of the marker and then <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; * query for the coordinate of that pixel position<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; */<br />
&nbsp; &nbsp; &nbsp; &nbsp; var coordinate = map.pixelToGeo(evt.displayX - offset.x + marker.anchor.x, evt.displayY - offset.y + marker.anchor.y);<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; // If the marker is dragged above a zone where it may not be dropped<br />
&nbsp; &nbsp; &nbsp; &nbsp; if (evt.dataTransfer.dropEffect === &quot;none&quot;) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // If this is the end of the drag<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (evt.type === &quot;dragend&quot;) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // then the marker will jump back to where it was; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; updateInputValue(marker, marker.coordinate.toString());<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // otherwise it is currently (while being dragged) above an invalid drop zone<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; updateInputValue(marker, &quot;Invalid drop zone!&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; else {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // If the marker is somewhere above the map, update info text with the new coordinate.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; updateInputValue(marker, coordinate.toString());<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; }<br />
};<br />
<br />
/* Create a helper method that updates the text fields associated with the <br />
&nbsp; &nbsp; * marker passed as argument<br />
&nbsp; &nbsp; */<br />
var updateInputValue = function (draggedMarker, text) {<br />
&nbsp; &nbsp; if (draggedMarker === marker)<br />
&nbsp; &nbsp; &nbsp; &nbsp; $(&quot;input[name*='txtGeoLocation']&quot;).val(text);<br />
&nbsp; &nbsp; //markerPosUiElt.innerHTML = text;<br />
};</code><hr />
</div>The problem I'm having is that the latitude / longtitude outputs in long format when I need it in decimal format.<br />
<br />
I've tried changing the following lines:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">updateInputValue(marker, marker.coordinate.toString());</code><hr />
</div>To the following:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">updateInputValue(marker, marker.coordinate.latitude.ToString() + ', ' + marker.coordinate.longitude.ToString());</code><hr />
</div>But then my text box stops populating (I imagine an error is throwing which isn't bubbling up). I've even tried just retrieving the latitude with the following:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">updateInputValue(marker, marker.coordinate.latitude.ToString());</code><hr />
</div>But I still receive no output.<br />
<br />
How can I accomplish this? I definitely don't want a long format latitude / longitude and only wish to write the decimal version on this to my textbox.</div>

]]></content:encoded>
			<category domain="http://www.developer.nokia.com/Community/Discussion/forumdisplay.php?283-Maps-API-for-Javascript">Maps API for Javascript</category>
			<dc:creator>ElvisLikeBear</dc:creator>
			<guid isPermaLink="true">http://www.developer.nokia.com/Community/Discussion/showthread.php?240171-How-can-I-retrieve-a-decimal-latitude-longitude-when-dragging-a-marker</guid>
		</item>
		<item>
			<title>Memory Leak when removing and adding markers.</title>
			<link>http://www.developer.nokia.com/Community/Discussion/showthread.php?240134-Memory-Leak-when-removing-and-adding-markers&amp;goto=newpost</link>
			<pubDate>Fri, 26 Apr 2013 14:55:17 GMT</pubDate>
			<description>Sample code below - very simple map, adds and removes markers on a timer.  
 
Using Chrome dev tools, can see memory rapidly climb from 11 megs, to 50 megs  megs, within 6 minutes.  (see http://i.imgur.com/EN23tBX.png) 
 
addMarkersWithCleanup() is an attempt to aggressively destroy the objects...</description>
			<content:encoded><![CDATA[<div>Sample code below - very simple map, adds and removes markers on a timer. <br />
<br />
Using Chrome dev tools, can see memory rapidly climb from 11 megs, to 50 megs  megs, within 6 minutes.  (see <a href="http://i.imgur.com/EN23tBX.png" target="_blank">http://i.imgur.com/EN23tBX.png</a>)<br />
<br />
addMarkersWithCleanup() is an attempt to aggressively destroy the objects myself.  Makes no difference. <br />
<br />
Manually invoking the chrome garbage collector does not help. <br />
<br />
Is there some different way we should be removing markers?  If not, this definitely seems like a definite leak. <br />
<br />
On our actual app, this is resulting a loss of 300kb every 10 seconds, and the app is meant to stay open for hours on end...<br />
<br />
Thanks. <br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">&lt;%@ Page Language=&quot;C#&quot; Inherits=&quot;System.Web.Mvc.ViewPage&lt;WipViewModel&gt;&quot; %&gt;<br />
<br />
&lt;!DOCTYPE html&gt;<br />
<br />
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;<br />
&lt;head runat=&quot;server&quot;&gt;<br />
&nbsp; &nbsp; &lt;title&gt;Nokia map - Memory test&lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&nbsp; &nbsp; &lt;div id=&quot;mapContainer&quot; style=&quot;width: 1024px; height: 768px;&quot;&gt;<br />
&nbsp; &nbsp; &lt;/div&gt;<br />
&nbsp; &nbsp; &lt;script type=&quot;text/javascript&quot; charset=&quot;UTF-8&quot; src=&quot;http://api.maps.nokia.com/2.2.4/jsl.js?with=maps,datarendering&quot;&gt;&lt;/script&gt;<br />
&nbsp; &nbsp; &lt;script&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; nokia.Settings.set(&quot;appId&quot;, &quot;&lt;%= Model.NokiaMapAppId %&gt;&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; nokia.Settings.set(&quot;authenticationToken&quot;, &quot;&lt;%= Model.NokiaMapAuthenticationToken %&gt;&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; var UK_COORDINATE = { latitude: 52.308479, longitude: -1.351318 };<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; // Get the DOM node to which we will append the map<br />
&nbsp; &nbsp; &nbsp; &nbsp; var mapContainer = document.getElementById(&quot;mapContainer&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; // Create a map inside the map container DOM node<br />
&nbsp; &nbsp; &nbsp; &nbsp; var map = new nokia.maps.map.Display(mapContainer, {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Initial center and zoom level of the map<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; center: UK_COORDINATE,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; zoomLevel: 7,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // We add the behavior component to allow panning / zooming of the map<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; components: [new nokia.maps.map.component.Behavior()]<br />
&nbsp; &nbsp; &nbsp; &nbsp; });<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; setInterval(addMarkersWithCleanup, 3000);<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; // This function just add markers and clear them from the list itself<br />
&nbsp; &nbsp; &nbsp; &nbsp; function addMarkers() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log(&quot;Clearing markers&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; map.objects.clear();<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log(&quot;Adding markers&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for (var i = 0; i &lt; 50; i++) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var standardMarker = new nokia.maps.map.StandardMarker(getRandomCoordinate());<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Next we need to add it to the map's object collection so it will be rendered onto the map.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; map.objects.add(standardMarker);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log(&quot;All markers added&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; // This function adds markers and destroy them which remove them from any display<br />
&nbsp; &nbsp; &nbsp; &nbsp; function addMarkersWithCleanup() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var size = map.objects.getLength();<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log(&quot;Total objects on map before adding: &quot; + size);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (size &gt; 0) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log(&quot;Destroying all objects&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for (var i = 0; i &lt; size; i++) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var marker = map.objects.get(0);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; marker.destroy();<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; size = map.objects.getLength();<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log(&quot;Total objects remaining after clean up:&nbsp; &quot; + size);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; size = map.objects.getLength();<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Only add if we are sure there is nothing left on the map<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (size &lt;= 0) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log(&quot;Adding markers&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for (var i = 0; i &lt; 200; i++) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var standardMarker = new nokia.maps.map.StandardMarker(getRandomCoordinate());<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Next we need to add it to the map's object collection so it will be rendered onto the map.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; map.objects.add(standardMarker);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; console.log(&quot;All markers added&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; function getRandomCoordinate() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return new nokia.maps.geo.Coordinate(this.getRandomNumber(50, 60), this.getRandomNumber(-1, -5));<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; function getRandomNumber(min, max) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return parseFloat((Math.random() * (max - min + 1) + min).toFixed(6));<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; &lt;/script&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</code><hr />
</div></div>

]]></content:encoded>
			<category domain="http://www.developer.nokia.com/Community/Discussion/forumdisplay.php?283-Maps-API-for-Javascript">Maps API for Javascript</category>
			<dc:creator>tktr</dc:creator>
			<guid isPermaLink="true">http://www.developer.nokia.com/Community/Discussion/showthread.php?240134-Memory-Leak-when-removing-and-adding-markers</guid>
		</item>
		<item>
			<title>Complete Rooting system using two input with autocomplete</title>
			<link>http://www.developer.nokia.com/Community/Discussion/showthread.php?240085-Complete-Rooting-system-using-two-input-with-autocomplete&amp;goto=newpost</link>
			<pubDate>Tue, 23 Apr 2013 09:03:13 GMT</pubDate>
			<description>Hi nokia Community, 
I am trying desperatly to make a form with two input where the user will have to enter the first two letters of a city and the Places API will return propositions by autocompleting. Then the user click on the city/adress for both input, click on a button for valid the request,...</description>
			<content:encoded><![CDATA[<div>Hi nokia Community,<br />
I am trying desperatly to make a form with two input where the user will have to enter the first two letters of a city and the Places API will return propositions by autocompleting. Then the user click on the city/adress for both input, click on a button for valid the request, and finally the maps display a rooting between the start City and the arrival City.<br />
For now I succeed to make a simple search request with one input and displaying the result on the map but not for keeping in an array the location of this result for use it after in the rooting definition.<br />
<br />
Is there a tutorial existing about this because I watch the doc, the wiki but I began to be completly lost even if I know that I'm close! :)<br />
<br />
Thank you for any responses.<br />
<br />
Best Regards.</div>

]]></content:encoded>
			<category domain="http://www.developer.nokia.com/Community/Discussion/forumdisplay.php?283-Maps-API-for-Javascript">Maps API for Javascript</category>
			<dc:creator>Gaius Baltar</dc:creator>
			<guid isPermaLink="true">http://www.developer.nokia.com/Community/Discussion/showthread.php?240085-Complete-Rooting-system-using-two-input-with-autocomplete</guid>
		</item>
	</channel>
</rss>
