Write some code for infoboxes from geojson using Bing Maps SDK
$10-30 AUD
In Progress
Posted about 7 years ago
$10-30 AUD
Paid on delivery
Hi,
I'm teaching myself how to use Bing Maps SDK to create online maps. I'm having trouble creating infoboxes for my geojson feed & would appreciate it if someone could write the code.
Example:
http://www.bing.com/api/maps/sdkrelease/mapcontrol/isdk#reuseInfobox+JS
In the link above, if you click a point on the map, an infobox pops up with description/title.
Please cut'n paste the code below into the Bing Maps SDK javascript windows:
var map = new [login to view URL]([login to view URL]('myMap'), {
credentials: 'Your Bing Maps Key',
});
//Load GeoJSON module.
[login to view URL]('[login to view URL]', function () {
//Read the GeoJSON file that is hosted on a different domain but has CORs enabled.
[login to view URL]('[login to view URL]',
function (shapes) {
//Add the shape(s) to the map.
[login to view URL](shapes);
});
});
As you will see, when you click on the points from the geojson feed, they doesn't have infoboxes.
Below is an example of the attributes from the geojson feed:
{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"OBJECTID":25,"ID":"CAM00080","Title":"MF/HODGES DR WEBCAM - CAM080","Direction":"NW","href":"[login to view URL]"},"geometry":{"type":"Point","coordinates":[115.76402900000005,-31.755038999155115]}},
Could you please write some code which addes infoboxes to my geojson points. Please populate the infobox with info from the geojson feed. For example:
ID: CAM00080
Title: MF/HODGES DR WEBCAMCAM080
Direction: NW
href: [login to view URL]
Lastly, if my geojson had info for a jpeg... I would like the photo to display in the infobox.
I will cut'n paste your code into the Bing Maps SDK to see how it works.
Hope that makes sense.
Please see this forum post if you need more info:
[login to view URL]
Look forward to hearing from you.
Cheers
Nick