I am trying to set multiple markers, getting address fetching from database and storing it to javascript array variable, then by running a loop trying to set markers in my map, but its not working.
This is my working URL : http://projects.pronixtech.net/kindcampaign/kind-country/
Please look to the source code, and please guys help me i have already given my full day on this.
FYI There is a JS error on your page i.e it could not find $(".videopan") i guess and you need not do the replace of px etc for parsing you could do
parseInt($(".videopan").css("left"))
i.e
parseInt("50px")=50
Related
I'm trying to fetch "current / max Players" from this site:
http://rust-servers.net/server/64099/
I would like to display just the player numbers, eg. "70 / 175" on another website and have it update every time someone visits my .html page (I can change that one to .php if needed.)
How would I go about doing that in the most simple and efficient way?
I've googled the issue for some hours without any luck, I'm no closer to understanding what I would want to use to do this as everyone seems to suggest widely different methods and most seem way too verbose for the simple thing I'm trying to do - many examples fetch the data as JSON (?) with some JS/jQuery (?) and use a bit of code to find specific items in that data, define it as a variable or array and then display it later.
I've figured that the information I want can be referred to using XPath "/html/body/div[4]/div/div/div[9]/div[1]/table/tbody/tr[4]/td[2]/strong" but that's about it. How do I proceed from there?
Thank you.
It depends on which platform do you want to use.
If you use C#, you can use HtmlAgilityPack library.
It is basically like this:
var webClient.DownloadString("http://rust-servers.net/server/64099/");
var doc = new HtmlAgilityPack.HtmlDocument();
doc.LoadHtml(htmlCode);
var node = doc.DocumentNode.SelectSingleNode("/html[1]/body[1]/div[4]/div[1]/div[1]/div[9]/div[1]/table[1]/tbody[1]/tr[4]/td[2]");
var nodeValue = node.InnerText;
I am using the Youtube Api for AS3 and i used the function player.getCurrentTime so that I can get the current time of the video. I have been running into this error https://code.google.com/p/gdata-issues/issues/detail?id=6215 and I really need to get this fixed is there any solutions to this problem or a way around it. I am just trying to save the current video progress to a variable and access that variable later here is my code used for this function
mis_player = new my_players(vidSource, mis_players.my_play.getCurrentTime());
and here is the code used for using the var both work fine at first then display the second value as the end of the video
my_play.seekTo(currTime1)
I figured it out, by sending the variable through the function I was able to pass the variable through to the function.
I am working on a fairly simple Heat Map application where the longitude and latitude of the points will be stored in a SQL Server database. I have been looking at an example that uses an array of objects as follows (eliminated a lot of data for brevity):
/* Sample data to demonstrate Bing Maps Heatmap */
/* http://alastair.wordpress.com */
var CrimeData = [
new Microsoft.Maps.Location(52.67280, 0.94392),
new Microsoft.Maps.Location(52.62423, 1.29493),
new Microsoft.Maps.Location(52.62187, 1.29080),
new Microsoft.Maps.Location(52.58962, 1.72228),
new Microsoft.Maps.Location(52.69915, 0.24332),
new Microsoft.Maps.Location(52.51161, 0.99350),
new Microsoft.Maps.Location(52.59573, 1.17067),
new Microsoft.Maps.Location(52.94351, 0.49153),
new Microsoft.Maps.Location(52.64585, 1.73145),
new Microsoft.Maps.Location(52.75424, 1.30079),
new Microsoft.Maps.Location(52.63566, 1.27176),
new Microsoft.Maps.Location(52.63882, 1.23121)
];
What I want to do is present the user with a list of some sort that displays all the data sets that exist in the database (they each have a name associated with them) and then allow the user to check all or only a select few. I will then need to generate an array like the above to create the heat map. Any ideas on a good approach to this?
What you trying to achieve is more related to a web developement rather than only related to Bing Maps.
To summarize, you have multiple ways to do this but it really depends on what you are capable to do and what you need in the interface.
What process/technology?
First, you need to determine what process you want to follow to display the data and it will set the technology that you will use. The questions that you need to ask yourself are:
Do you want to be able to change the data sets dynamically without refreshing the whole page?
If yes, it means that you will have to use asynchronous data loading through a dedicated web service in order to avoid loading all the information at the initial load of the page.
Do you have lots of data to load?
If so, it might comfort you with asynchronous loading to avoid loading all data.
If not loading every elements in multiple arrays might be the simplest solution.
Implementation
So now, you want to create a web service to load the data asynchronously, you can take a look at the following websites :
http://www.asp.net/get-started
http://www.stefanprodan.com/2011/04/async-operations-with-jquery-ajax-and-asp-net-mvc/
There might be interesting other website, you will be able to find them. If needed, add comment and I'm sure the community will help you.
If you want to generate the data directly in the script, it could be simple as you can compose the JavaScript directly in your dynamically created HTML page (in your ASP.Net markup code or whatever technology you're using).
My GoogleFu has failed me, all the results I'm getting are people who accept lat/longs in text fields and need to generate a map... I need the opposite of that.
I want my users to:
Load the page, see a small clickable google map as a part of a form
Click on that map, or "drag" an already existing map marker to a new location
Once the form is submitted, I want the LAT + LONG of the map markers location (it's updated position, after it's been dragged) to be inserted into an SQL database.
I can't seem to find any guides or documentation online that would let me achieve something like this; would anybody mind pointing me in the right direction?
Add a input to the form(may be hidden) and observe either the click-event of the map(when creating a new marker) or the dragend-event of the existing marker.
In the callback of both events a google.maps.MouseEvent is available which contains the related LatLng-object, which may be used to set the value of the input(not directly, it's not a string, use e.g. latLng.toString() or build another string that fits your needs).
I have a Google Streetview panoid list, i want to find out their locations(latlng), How do i make it ?
Thanks !
Use the method getPanoramaById() of the StreetViewService to retrieve the panoramaData. The response will contain a location-property with data related to the location, e.g. the latLng
I had a similar problem as the original poster. Using the API works, but isn't the best if you're just looking to convert panoIDs to lat/lon's. The following python code works much better for this task: https://code.google.com/p/adqmisc/source/browse/trunk/streetview/StreetView.py