Issue with "ZoomBar" component display
I have pieced together a map where I pass in a string of addresses and it creates markers for the various locations. For UI tools/components I have only added the following:
components: [
new nokia.maps.map.component.Behavior(),
new nokia.maps.map.component.ZoomBar()
]
This works and displays properly on my development server but when I publish the same exact code to my production server the map still pulls up the locations but also has what appears to be an extra layer over the top and right side of the map that displays a black box across the top 25% of the map and the following string 5 times with the last number incrementing each time along the right:
"__i18n_ovi.service.map_t17__"
"__i18n_ovi.service.map_t18__"
"__i18n_ovi.service.map_t19__"
...and so on.
If I remove the ZoomBar() from the components list the extra layer disappears and the map is clean and functional but obviously does not have the visible ZoomBar which my users would like to see, especially if they do not have a scroll wheel to zoom with on their mouse or laptop.
I would be glad to post a small screen shot but my forum permissions state I cannot add an attachment.
Any idea why the ZoomBar would display properly on one server and not another?
Thanks!
Re: Issue with "ZoomBar" component display
That's a difficult one to diagnose without pictures -could you try posting some code instead?
My guess is that this is a browser/HTML valdiation issue. Firstly if you are testing on IE, ensure the following line is in the<head>
[CODE]<meta http-equiv="X-UA-Compatible" content="IE=7; IE=EmulateIE9" />[/CODE]
Secondly, try validating your HTML using something like: [url]http://infohound.net/tidy/[/url], if you have an unclosed <div> on your page different browsers will treat this in different ways. For the Zoombar and other visible controls, the API is injecting various html elements into the DOM - the effect of using invalid HTML will be to display the controls incorrectly.
Re: Issue with "ZoomBar" component display
Jason,
Thank you for your time in looking at this issue.
You are correct in that I am using IE and I have the <meta> tag you referenced in my <head> tag.
I will try the validation link you added as well but I use the same browser to view both the development server and live server so I don't know why the same page would display differently just because it is hosted in another location.
Here is a screen shot of the issue:
[img]http://i.imgbox.com/adqoKHXs.png[/img]
Any ideas?
Re: Issue with "ZoomBar" component display
Anyone have any ideas why the map works in the same browser on the same computer when I am accessing it from one server but then does not work properly when accessing the same page on another server?
Thanks again!
1 Attachment(s)
Re: Issue with "ZoomBar" component display
Hmmm, very tricky without analysing your server set up and the code. It appears that for some reason, the labels for the localization of the API are not being downloaded. Here are a series of suggestions.(of increasing difficulty)
1) Try loading the basic example with components [URL="http://developer.here.net/apiexplorer/examples/api-for-js/getting-started/basic-map-with-components.html"]here[/URL], and see if it causes you the same error. A copy of this example can be used as a basis for further discussion
and removes any doubt as to where the issue lies.
2) Try making a local copy of the "basic example with components " example and see what happens when accessed as a local file and when hosted on your server.
3) Try forcing the language to German say, by adding the following line after your app id and token:
[CODE]nokia.Settings.set("defaultLanguage", "de-DE");[/CODE]
4) Open the example localhost and on the server in Google Chrome , press F12 to open the debugger and press the [B]Scripts[/B] tab then reload the page, you should see a [B]language-en-US.js[/B] script being loaded. This holds the missing texts.
[ATTACH]1432[/ATTACH]
For each of these ensure that the local cache has been cleared so that there aren't any side effects from residual code.
If for some reason your server or a proxy is blocking the [B]language-en-US.js[/B] script then this is potentially the cause of your problem.
Re: Issue with "ZoomBar" component display
Had better give more code.
Re: Issue with "ZoomBar" component display
I think it's a javascript runtime error.
Re: Issue with "ZoomBar" component display
[QUOTE=jkemailtest;908333]
Anyone have any ideas why the map works in the same browser on the same computer when I am accessing it from one server but then does not work properly when accessing the same page on another server?
[/QUOTE]
On further investigation, I think I've cracked this. I think you must be testing your map using [B]Internet Explorer[/B], and the browser has been forced into [B]quirks mode[/B] somehow.
The API does not support [B]quirks mode[/B] since by definition it doesn't support web standards. It only exists in order to avoid “breaking” pages authored according to practices that were prevalent in the late 1990s.
I can deliberately "break" the map by [B]forcing [/B] Internet explorer into quirks mode (try your working local map in IE 8, press F12 and set Document Mode:Quirks)
The [URL="http://blogs.msdn.com/b/ie/archive/2010/03/02/how-ie8-determines-document-mode.aspx"]MSDN blog[/URL] explains which mode the browser will use. It is likely your rogue server is somehow forcing browsers into using quirks. If you set up the server to use standards mode all will be well.
Re: Issue with "ZoomBar" component display
[QUOTE=jasfox;908831]On further investigation, I think I've cracked this.[/QUOTE]
That was it! After following the flowchart in the MSDN blog you provided I was able to have the page change the mode in the browser and the zoombar displayed properly.
Thanks again!