Via a style can hide such poi.
(the wizard linked on that page, is a good way to interactivly get the
style you want)
> --
> You received this message because you are subscribed to the Google Groups
> "Google Maps JavaScript API v3" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-maps-js-api-v3/-/uOOm6WZlQ4cJ.
> To post to this group, send email to google-map...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-maps-js-a...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-maps-js-api-v3?hl=en.
>
<script type="text/javascript"
src="http://maps.google.com/maps/api/js?sensor=false">
</script>
<script type="text/javascript">
function initialize() {
var myProperty = new google.maps.LatLng(-41.13495,-71.313466);
var myLatlng = new google.maps.LatLng(-41.13495,-71.313466)
var myOptions={scrollwheel: false,
zoom: 16,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
var marker = new google.maps.Marker({
position: myProperty,
map: map,
icon: 'http://www.rentalsbariloche.com/media/apartment.png',
clickable: false,
title:'Apartment One',
animation: google.maps.Animation.DROP
});
}
</script>
but think I have to add this somewhere??:[
{
featureType: "poi.business",
elementType: "labels",
stylers: [
{ visibility: "off" }
]
}
]
http://code.google.com/apis/maps/documentation/javascript/styling.html#styling_the_default_map
Add "styles" to the myOptions array, or use setOptions to set it seperately.
<script type="text/javascript"
src="http://maps.google.com/maps/api/js?sensor=false">
</script>
<script type="text/javascript">
function initialize() {
var myProperty = new google.maps.LatLng(-41.13495,-71.313466);
var myLatlng = new google.maps.LatLng(-41.13495,-71.313466)
var myOptions={scrollwheel: false,
zoom: 16,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
var marker = new google.maps.Marker({
position: myProperty,
map: map,
icon: 'media/apartment.png',
map.setOptions({styles: [
{
featureType: "poi.business",
elementType: "labels",
stylers: [
{ visibility: "off" }
]
}
]});
Also you need to put it after you create the map. The link you showed
had it after.
There is absolutly no need for the complicated(ish) function that Pil showed
http://www.nearby.org.uk/google/temp/no-hotels1.php
> --
> You received this message because you are subscribed to the Google Groups
> "Google Maps JavaScript API v3" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-maps-js-api-v3/-/Yk6ak13VsAsJ.
http://www.nearby.org.uk/google/temp/no-hotels2.php
Who said anything about wanting to turn off labels anyway? Wasnt in
bigfoot1's question.
> The prolongation of my previous example is not just for fun.
>
> --
> You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
Interesting argument (meta: is this a argument for the sake of an
argument?), but as we having this argument, often redundancy is used
deliberately. To be clear and unabigious about ones intentions etc. A
large percentage of semi-colons at the end of javascript lines are
redundant - but most coders supply them anyway.
Having elementType of labels just clarifies the intention, even
though the default of 'all' would encompass it too.
I didnt supply the actual style used anyway. bigfoot1 found it somewhere. :)
needed: no.
good to include anyway: yes.
>
> Should it really be used altough it's not only redundant but does
> something completely different when executed
Not to me it doesnt. Perhaps you using it wrong.
With it:
http://www.nearby.org.uk/google/temp/no-hotels2.php
Without it:
http://www.nearby.org.uk/google/temp/no-hotels22.php
Set to all
http://www.nearby.org.uk/google/temp/no-hotels23.php
All behave identical.
(You can test things like this easier using the styling wizard)
Not a secret. I guess just to me makes more sense (to me).
As much as anything its about predictablity.
Being as specific as posible - ie that just want to turn the
poi.business labels off. Is better than turning the whole of
poi.business. turning off the whole of poi.business off, might have
unpredictable results. We dont know.
Specifiy "exacly what want to do", rather than a broader "do all this"
just becauase it happens to do just that.
Say you have a single file in the folder. And you want to delete it.
* You could delete the folder. It would delete the file. And would
work just fine.
Now later, you add some more unrelated files to the folder (for what
ever reason).
Again you want to delete the single file, so you execute your "delete
folder" procedure. Result: the file has been deleted - good. (But so
have these other files - this is probably unintended. - bad)
So to delete the file, you delete the file - its safer. It more
robust. It jsut does what is intended.
>
> Look at my example above to see the difference when the 'labels' are
> hidden and when the 'pois' are hidden.
Yes, because [elementType: "labels"] - without a featureType is the
same as a [featureType: "all"] - ie it removes all labels from the map
- affects every single feature.
If you intending to remove all labels then fine.
Same as [featureType: "poi.business"] - without a elementType is the
same as a [elementType: "all"] - ie removes all business features -
effects all elements.
If you intending to all business data (ie the geometry too) then fine.
But be sure that is what you want to do.
>
>
> On Sep 1, 4:34 pm, Barry Hunter <barrybhun...@gmail.com> wrote:
>> On Thu, Sep 1, 2011 at 2:31 PM, Pil <wolf...@gmail.com> wrote:
>> > Barry,
>>
>> > be honest: Do you think that this line
>>
>> > elementType: "labels"
>>
>> > is needed when poi.business should be turned off?
>>
>> needed: no.
>>
>> good to include anyway: yes.
>>
>>
>>
>> > Should it really be used altough it's not only redundant but does
>> > something completely different when executed
>>
>> Not to me it doesnt. Perhaps you using it wrong.
>>
>> With it:http://www.nearby.org.uk/google/temp/no-hotels2.php
>>
>> Without it:http://www.nearby.org.uk/google/temp/no-hotels22.php
>>
>> Set to allhttp://www.nearby.org.uk/google/temp/no-hotels23.php
>>
>> All behave identical.
>>
>> (You can test things like this easier using the styling wizard)
>
> --
> You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
I dont understand what yo mean there.
As I see it, its for affecting the label "element"s, of what ever
featureType you (or dont) specify.
>
> 2. It is redudant.
Actully further to what I said before, seems I was wrong. Specifying
elementType: "labels" is acutlly different to "all" (or missing)
If you specify "labels", then you just hide labels. If you leave
elementType off altogether (or explictly say "all"() then you hiding
"geometry" too.
There arent many geometries attached to poi.business. But they do
exist. Look at new york city for example. there are a few. Use the
style wizard to toggle geometry on and off to see :)
(enter "loc: 40.734099,-73.945977" into the 'enter a location' box top right)
So leaving it off, has changed the meaning.
>
> 3. It leads to confusion.
Cant disagree there, given this conversation :)
>
> 4. It complicates things more than necessary.
Given the fact that it actully changes what is displayed, can only now
disagree.
So my answer would be "needed" - yes.