Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-03-2013, 11:30 PM   PM User | #46
xelawho
Senior Coder

 
xelawho's Avatar
 
Join Date: Nov 2010
Posts: 2,437
Thanks: 52
Thanked 454 Times in 452 Posts
xelawho will become famous soon enoughxelawho will become famous soon enough
Google maps on android (which they probably spent most time developing, considering) has pinch and unpinch as well as the zoom buttons. The other right click features (directions, search and others) are on the menu that pops up with a left button click.

in case we were interested
xelawho is offline   Reply With Quote
Old 01-03-2013, 11:30 PM   PM User | #47
MrTIMarshall
Regular Coder

 
Join Date: Nov 2010
Posts: 347
Thanks: 44
Thanked 1 Time in 1 Post
MrTIMarshall is an unknown quantity at this point
I guess that sounds okay as then I can make a bunch of vars and say something like this right?

var FirstMission = 1:3

if checked remove 1:3 image

I know that's not Javascript apart from the var but hopefully you understand what I mean there to say if thats possible or not as I need to be able to remove them and a remove all of them if they choose to just look at the map but seek no help.
MrTIMarshall is offline   Reply With Quote
Old 01-03-2013, 11:46 PM   PM User | #48
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,247
Thanks: 59
Thanked 3,998 Times in 3,967 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
It needs to be an array. If there are many different kinds of markers, do it like this:

Code:
var markers = {
    "1:3" : "firstMission",
    "17:22" : "gold",
    "21:7" : "drown"
};
Or you could use the actual URLs of the images instead of names. If you do use names, then we have to have *another* table that matches name to image URL, anyway.
Code:
var markerImages = {
    "firstMission" : "/images/questionMark.png",
    "gold" : "/images/goldIcon.png",
    "drown" : "/images/blub_blub_blub.png"
};
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Old 01-03-2013, 11:48 PM   PM User | #49
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,247
Thanks: 59
Thanked 3,998 Times in 3,967 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Another alternative:
Code:
var markers = {
    "/images/questionMark.png" : [ "3:17", "22:4", "18:9" ],
    "/images/goldIcon.png" : [ "41:8" ], /* make it an array even if only one */
    "/images/blub_blub_blub.png" : [ "21:2", "21:3", "21:4" ]
}
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Old 01-04-2013, 01:49 PM   PM User | #50
MrTIMarshall
Regular Coder

 
Join Date: Nov 2010
Posts: 347
Thanks: 44
Thanked 1 Time in 1 Post
MrTIMarshall is an unknown quantity at this point
Code:
var markers = {
      "Chest_Gold" : [ "1:26", "16:28", "5:9", "13:25", "5:9" ]
      "Chest_Metal" : [ "1:11", "10:25", "14:25" ]
      "Chest_Rusty" : [ "6,5", "9:25", "1:24", "15:25", "23:25" ]
}
I have these so far, however unlike the here and new objective png images, the chest images are 200x137px. Would it be best to scale them down to the maximum size they can be in the tiles and go from there?
MrTIMarshall is offline   Reply With Quote
Old 01-04-2013, 07:40 PM   PM User | #51
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,247
Thanks: 59
Thanked 3,998 Times in 3,967 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Quote:
Originally Posted by MrTIMarshall View Post
I have these so far, however unlike the here and new objective png images, the chest images are 200x137px. Would it be best to scale them down to the maximum size they can be in the tiles and go from there?
Yes. Not necessary, but will make the page more efficient.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:19 AM.


Advertisement
Log in to turn off these ads.